argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
15.08k stars 3.2k forks source link

add workflow labels to metrics? #9849

Open linkingli opened 2 years ago

linkingli commented 2 years ago

Summary

add workflow labels to the metric?

Use Cases

When I have two workflowTemplates (A,B), I want to know the overall situation of workflow of A and B respectively. The current metric does not support me to do this. Since there is no label for workflow.

NOW:

argo_workflows_count{container="workflow-controller", endpoint="metrics", 
instance="127.0.0.1:9090", job="workflow-controller-metrics", namespace="argo",
 pod="workflow-controller-7d69c4b564-t6xn8",
 service="workflow-controller-metrics", status="Error"}

BETTER:

argo_workflows_count{container="workflow-controller", endpoint="metrics", 
instance="127.0.0.1:9090", job="workflow-controller-metrics", namespace="argo",
 pod="workflow-controller-7d69c4b564-t6xn8",
 service="workflow-controller-metrics", status="Error",labelName="LabelValue"}

Message from the maintainers:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

LilTwo commented 1 year ago

Hi @terrytangyuan , is this a considerable enhancement? If so, I can do some studies about it, currently there is no way to know pending workflow count since even with custom metrics, that is very inconvenient if you run many kinds of workflows in your cluster

terrytangyuan commented 1 year ago

Yeah feel free to submit a proposal

moonyoungCHAE commented 1 year ago

I found it can be work on custom metrics. And I'm worried about that if workflow name is added on default metric labels, it can be create huge amount of metrics.

LilTwo commented 1 year ago

Hi @terrytangyuan opened a PR, please take a look if you have time, thanks!

tooptoop4 commented 1 month ago

k8s pod metrics (not argo) include pod name, so seems reasonable to include workflow name