Monday, June 14, 2021

Argo workflow - Prometheus metrics

https://argoproj.github.io/argo-workflows/metrics/#metric-spec


prometheus:
# Metric name (will be prepended with "argo_workflows_").
# Metric names can only contain alphanumeric characters, _, and :.
- name: metric_failed_with_output_result
# Metric definitions must include a name and a help doc string.
# (this is a Prometheus requirement)Metrics with the
# same name must always use the same exact help string,
# having different metrics with the same name,
# but with a different help string will cause an error.
help: "test run"
# Labels are optional. Avoid cardinality explosion.
labels:
- key: workflow_name
value: "{{ workflow.name }}"
- key: workflow_namespace
value: "{{ workflow.namespace }}"
- key: status
# different workflows may fail with the same error,
# so add unique workflow as prefix
value: "{{ workflow.name }}_{{ outputs.result }}"
# Emit the metric conditionally. Works the same as normal "when"
when: "{{ status }} == Failed"
# The metric type. Available are "gauge", "histogram", and "counter".
gauge:
# This increments the counter by 1
value: "{{duration}}"

No comments:

Post a Comment