Skip to content
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

{{workflow.status}} is not working in metrics #8895

Closed
2 of 3 tasks
eyalyoli opened this issue Jun 1, 2022 · 2 comments · Fixed by #8939
Closed
2 of 3 tasks

{{workflow.status}} is not working in metrics #8895

eyalyoli opened this issue Jun 1, 2022 · 2 comments · Fixed by #8939
Assignees
Labels
area/metrics area/templating Templating with `{{...}}` type/bug type/regression Regression from previous behavior (a specific type of bug)

Comments

@eyalyoli
Copy link

eyalyoli commented Jun 1, 2022

Checklist

  • Double-checked my configuration.
  • Tested using the latest version.
  • Used the Emissary executor.

Summary

What happened/what you expected to happen?

Running this example workflow for custom metrics at the workflow & template levels on the latest version (v3.3.6) publishes the workflow templates without status label!

Workflow metrics (playground_workflow_duration, playground_workflow_result_counter) are visible in prometheus without the status label => {{workflow.status}} is not giving any value.
While template metrics (playground_workflow_duration_task_seconds, playground_workflow_result_task_counter) with status label of {{status}} is working fine.

What version are you running?

3.3.6

This previously worked on version 3.2.9

Diagnostics

Paste the smallest workflow that reproduces the bug. We must be able to run the workflow.

a shorter version of this example

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: dag-task-
spec:
  entrypoint: dag-task
  metrics: # Custom metric workflow level
    prometheus:
      - name: playground_workflow_new
        help: "Count of workflow execution by result status  - workflow level"
        labels:
          - key: "playground_id_workflow_counter"
            value: "test"
          - key: status
            value: "{{workflow.status}}"
        counter:
          value: "1"
  templates:
  - name: dag-task
    dag:
      tasks:
      - name: TEST-ONE
        template: echo

  - name: echo
    container:
      image: alpine:3.7
      command: [echo, "hello"]
# Logs from the workflow controller:
kubectl logs -n argo deploy/workflow-controller | grep ${workflow} 

# If the workflow's pods have not been created, you can skip the rest of the diagnostics.

# The workflow's pods that are problematic:
kubectl get pod -o yaml -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded

# Logs from in your workflow's wait container, something like:
kubectl logs -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded

Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

@eyalyoli eyalyoli changed the title {{workflow.status}} is not working in metrics {{workflow.status}} is not working in metrics Jun 1, 2022
@sarabala1979 sarabala1979 added the type/regression Regression from previous behavior (a specific type of bug) label Jun 2, 2022
@sarabala1979
Copy link
Member

@dpadhiar Can you take a look?

dpadhiar added a commit to dpadhiar/argo-workflows that referenced this issue Jun 9, 2022


Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
@stale

This comment was marked as resolved.

@stale stale bot added the problem/stale This has not had a response in some time label Jun 23, 2022
sarabala1979 pushed a commit that referenced this issue Jun 23, 2022
* fix: workflow.status is now set properly in metrics. Fixes #8895

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

* test: add runtime metrics test

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

* feat: add duration to global runtime parameters

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>

* chore: rerun git tests

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
@sarabala1979 sarabala1979 mentioned this issue Jun 23, 2022
51 tasks
@sarabala1979 sarabala1979 mentioned this issue Jul 30, 2022
51 tasks
@agilgur5 agilgur5 added area/metrics area/templating Templating with `{{...}}` and removed problem/stale This has not had a response in some time labels Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics area/templating Templating with `{{...}}` type/bug type/regression Regression from previous behavior (a specific type of bug)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants