Closed mario45211 closed 3 years ago
For those who struggling with similar issue this is my workaround - I've concatenated my custom tag value into metric name and used metric_relabel_configs
Prometheus configuration like:
# metric name: com_hazelcast_jet_Metrics_my_tag=my_value
metric_relabel_configs:
- source_labels: [__name__]
regex: 'com_hazelcast_jet_Metrics_my_tag=(.*)'
replacement: '${1}'
target_label: my_tag
- source_labels: [__name__]
regex: '(com_hazelcast_jet_Metrics)_my_tag=.*'
replacement: '${1}'
target_label: __name__
# final query: com_hazelcast_jet_Metrics{my_tag=my_value}
Above, first one extract my_value
to my_tag
label and second trim metric name, removing the my_tag=my_value
part.
Hi Jet Team!
I am currently working on exposing my ow metrics from a Jet pipeline using Prometheus as described in doc. Question - it is possible to include my custom tag to those metrics when exposing them via Prometheus endpoint to pass some additional context and make me query/group metrics by such tag ?
Example:
Example of expected API:
Best regards!