0

I have some additional labels on Prometheus targets via service discovery and re-labeling, e.g. instance_name, or instance_id. enter image description here

I would like to propagate those labels from a specific target to defined alerts.

I read documentation through and through and tried different configurations, like the following one, but was not able to figure out how to achieve such propagation.

alert_relabel_configs:
- source_labels: ['__meta_oci_instance_id']
  target_label: 'instance_id'

metric_relabel_configs:
- source_labels: ['__meta_oci_instance_id']
  target_label: 'instance_id'
Vít Kotačka
  • 1,472
  • 1
  • 15
  • 40

1 Answers1

0

What you want to do is use relabel_configs to have this label as a target label (probably the instance label). Then in your alerting rule be careful to not lose the label, so for example use without rather than by.

brian-brazil
  • 31,678
  • 6
  • 93
  • 86