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

feat: allow custom labels for count metrics. Fixes #9849 #11636

Closed
wants to merge 2 commits into from

Conversation

LilTwo
Copy link
Contributor

@LilTwo LilTwo commented Aug 20, 2023

Fixes #9849

Motivation

Since all custom non-realtime metrics are emitted after workflow completed, and realtime metrics are emitted after workflow start to run.

Currently there is now way to know pending workflow count grouped by labels, name or others

Use case:
We use different semaphore configs for multiple kinds of workflows and need to have alerts to monitor if certain kind of workflows are blocked

Modifications

Allow users to add custom labels to arog_workflow_count
while keeping the metrics unchanged if new added fields are not presented

example:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: hello-world-
  labels:
    workflows.argoproj.io/archive-strategy: "false"
    test: "123"
  annotations:
    workflows.argoproj.io/description: |
      This is a simple hello world example.
spec:
  entrypoint: whalesay
  metrics:
    customLabels:
      count:
        key: "{{workflow.labels.test}}"
  templates:
  - name: whalesay
    container:
      image: docker/whalesay:latest
      command: [cowsay]
      args: ["hello world"]

resulting metrics
argo_workflows_count_new{key="123",status="Succeeded"} 1

Verification

Tests will be added after the design is confirmed

@LilTwo LilTwo force-pushed the custom-labels-for-metrics branch 6 times, most recently from 4277ae0 to fb3cce0 Compare August 22, 2023 03:41
@LilTwo LilTwo closed this Aug 22, 2023
@LilTwo LilTwo reopened this Aug 22, 2023
@LilTwo LilTwo closed this Aug 22, 2023
@LilTwo LilTwo reopened this Aug 22, 2023
@agilgur5
Copy link
Contributor

Fixes #9839

I think you meant #9849 😅 your title has it!

@LilTwo
Copy link
Contributor Author

LilTwo commented Aug 23, 2023

yes you're right, thanks😅

@LilTwo LilTwo closed this Aug 23, 2023
@LilTwo LilTwo reopened this Aug 23, 2023
@LilTwo LilTwo force-pushed the custom-labels-for-metrics branch 3 times, most recently from d3e64d4 to 027923f Compare August 25, 2023 15:16
Signed-off-by: LilTwo <w0005151@gmail.com>
Signed-off-by: LilTwo <w0005151@gmail.com>
@stale
Copy link

stale bot commented Sep 17, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the problem/stale This has not had a response in some time label Sep 17, 2023
@juliev0
Copy link
Contributor

juliev0 commented Nov 23, 2023

So sorry, I'm going through old PRs and I see that unfortunately this one has been forgotten. I will try to review it soon.

Argo Workflows needs more people approving PRs unfortunately. If your company is by chance interested, I am gauging interest in this idea.

@juliev0
Copy link
Contributor

juliev0 commented Dec 8, 2023

@LilTwo do you still want this one reviewed? I see the Stale bot marked it as "stale", which we recently removed since that was clearly unfairly marking PRs stale when somebody was waiting for them to be reviewed. I can remove that label if you like. Thanks for your patience!

@terrytangyuan
Copy link
Member

Closing since this has been inactive for several months. Feel free to re-open if you pick it up again.

@linkingli
Copy link

is there any reason why should we close this pr? i would like to have this fearture

@agilgur5 agilgur5 changed the title feat: allow custom labels for count metrics #9849 feat: allow custom labels for count metrics. Fixes #9849 Oct 16, 2024
@tooptoop4
Copy link
Contributor

where @LilTwo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics problem/stale This has not had a response in some time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add workflow labels to metrics?
6 participants