Giter Site home page Giter Site logo

Comments (6)

stephen-dahl avatar stephen-dahl commented on June 23, 2024 1

the description has been updated with a new run ensuring consistency between all the parts

from argo-workflows.

stephen-dahl avatar stephen-dahl commented on June 23, 2024 1

did some testing

  • {{workflow.labels.workflows.argoproj.io/creator}}: worked
  • {{workflow.labels.workflows.argoproj.io/cron-workflow}}: worked
  • {{=workflow.labels.workflows.argoproj.io/creator}}: MetricsError: unable to substitute parameters for metric 'exec_count': failed to evaluate expression: unknown name creator (1:39) | workflow.labels.workflows.argoproj.io/creator | ......................................^
  • {{=workflow.labels.workflows.argoproj.io/cron-workflow}}: MetricsError: unable to substitute parameters for metric 'exec_count': failed to evaluate expression: unknown name cron (1:39) | workflow.labels.workflows.argoproj.io/cron-workflow | ......................................^
  • {{=workflow.labels['workflows.argoproj.io/creator']}}: MetricsError: unable to substitute parameters for metric 'exec_count': failed to evaluate expression "workflow.labels['workflows.argoproj.io/creator']"
  • {{=workflow.labels['workflows.argoproj.io/cron-workflow']}}: MetricsError: unable to substitute parameters for metric 'exec_count': failed to evaluate expression "workflow.labels['workflows.argoproj.io/cron-workflow']"

from argo-workflows.

agilgur5 avatar agilgur5 commented on June 23, 2024

Follow-up from this Slack thread.

I tried using "{{workflow.labels.workflows.argoproj.io/cron-workflow}}"

received error MetricsError: unable to substitute parameters for metric 'exec_count': failed to resolve {{=workflow.labels['workflows.argoproj.io/cron-workflow']}}, unable to substitute parameters for metric 'exec_duration': failed to resolve {{=workflow.labels['workflows.argoproj.io/cron-workflow']}}

            value: "{{workflow.labels.workflows.argoproj.io/creator}}"

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 Workflow (not CronWorkflow)

In the thread, @tico24 wrote that this works:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: wibblewobble-
spec:
  metrics:
    prometheus:
      - name: exec_count
        help: "Count of workflow execution by result status - workflow level"
        labels:
          - key: name
            value: "{{workflow.labels.workflows.argoproj.io/creator}}"
          - key: status
            value: "{{workflow.status}}"
        counter:
          value: "1"

but not when using as a workflowSpec of a CronWorkflow. Tim's hypothesis there was: "My assumption is that the metrics parameters are unpacked before the cron label is applied to the running workflow, so it can't find the label - hence the error. I would agree that this is an issue."

expr brackets syntax

I suggested using the expr style brackets, i.e. {{=workflow.labels['workflows.argoproj.io/cron-workflow']}}. Per the error it seems like that didn't work either, although not entirely clear due to copy+paste errors as per above

I'm also not sure if brackets are potentially affected by #11549

from argo-workflows.

stephen-dahl avatar stephen-dahl commented on June 23, 2024

ya im all over the place, working on cleaning it up... sorry

from argo-workflows.

agilgur5 avatar agilgur5 commented on June 23, 2024

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 CronWorkflow as well? Since Tim said it didn't work when he tried a Workflow generated by a CronWorkflow

from argo-workflows.

stephen-dahl avatar stephen-dahl commented on June 23, 2024

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

from argo-workflows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.