Trouble with Prometheus relabel_configs Regex for Matching Specific URL Patterns

77 views Asked by At

I'm configuring Prometheus Operator and encountering an issue with relabel_configs in my setup. I need to match URLs based on specific conditions and relabel them accordingly, but I'm running into a regex-related error.

Here's the part of my configuration that's causing trouble:

          relabel_configs:
            - source_labels: [ __address__ ]
              regex: '.*(dispatcher).*'
              target_label: __param_target
              replacement: 'http://${1}/choose-your-country.html'
            - source_labels: [ __address__ ]
              regex: '.*(publish|dispatcher).*'
              target_label: __param_target
              replacement: 'https://${1}/system/health?tags=bundles,-security&httpStatus=WARN:500'
            - target_label: __address__
              replacement: 'blackbox-exporter-prometheus-blackbox-exporter:9115'

The goal is to:

If the url matches dispatcher or author end with the system endpoint

However I'm getting http://blackbox-exporter-prometheus-blackbox-exporter:9115/probe such url as a target instead of expected targets

0

There are 0 answers