Appending string to Prometheus target parameter

165 Views Asked by At

My Prometheus configuration contains the following:

- job_name: "spring-actuator-health"
  metrics_path: /probe
  params:
    module: [http_2xx]
  dns_sd_configs:
    - names:
      - 'tasks.notification-service'
      type: 'A'
      port: 8200
  relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - source_labels: [__param_target]
      target_label: instance

This might be a very simple question to answer but I somehow can't get my head around it: How can I add a static string /actuator/health to target parameter which comes from __address__?

So the resulting target would look something like 10.4.23.56:8200/actuator/health?

1

There are 1 best solutions below

1
On

If you want to change your metric path, you can change:

metrics_path: "/probe"

to:

metrics_path: "/actuator/health"