-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use label variables in metrics #13141
Comments
Follow-up from this Slack thread.
The description here seems to have copy+pasted a few different ones, so it's not exactly clear which variants you tried and which you didn't. All 3 of the above are different. dot syntax works on plain
|
ya im all over the place, working on cleaning it up... sorry |
the description has been updated with a new run ensuring consistency between all the parts |
did some testing
|
the middle two shouldn't work, so those are correct. the last two I would expect to work, so are buggy. Regarding the first two -- those worked on a |
all of my testing was done by setting the metrics in the controller config workflow defaults, creating a cronworkflow, and submitting it through the UI |
I have slightly similar issue to this one and #3989 when using a Although the label It seems that the labels defined in the manifests are not being considered. |
I am also encountering this issue using the expr syntax. The log from the workflow-controller:
The expression: value: '{{= workflow.labels["example.com/environment-name"] }}' I tested the expression on expr Playground on this data and it worked as expected: workflow:
labels:
example.com/environment-name: "foo" |
For those looking for immediate solutions, the workaround which works for me is to use value: '{{= fromJSON(workflow.labels.json)["example.com/environment-name"] }}' Another thing to note is that labels on the |
Pre-requisites
:latest
image tag (i.e.quay.io/argoproj/workflow-controller:latest
) and can confirm the issue still exists on:latest
. If not, I have explained why, in detail, in my description below.What happened/what did you expect to happen?
https://cloud-native.slack.com/archives/C01QW9QSSSK/p1717447990226269
I tried using
"{{=workflow.labels['workflows.argoproj.io/cron-workflow']}}"
as a metric label inside a workflow created by a cron and received errorMetricsError: unable to substitute parameters for metric 'exec_count': failed to evaluate expression "workflow.labels['workflows.argoproj.io/cron-workflow']"
Version
latest
Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.
Logs from the workflow controller
Logs from in your workflow's wait container
The text was updated successfully, but these errors were encountered: