Fix regex for blackbox exporter targets
Fixes the regex used to match blackbox exporter targets in the prometheus.yml.j2 template to be less strict. Previously we were using \w which did not allow for names with periods or hyphens. Closes-Bug: #2098511 Change-Id: I3ac18bd12ed1dceef206040b3e793faa79717a19
This commit is contained in:
@@ -178,17 +178,17 @@ scrape_configs:
|
||||
{% endfor %}
|
||||
relabel_configs:
|
||||
- source_labels: [__address__]
|
||||
regex: (\w+):(\w+):(.+)
|
||||
regex: ([^:]+):([^:]+):(.+)
|
||||
target_label: service
|
||||
replacement: ${1}
|
||||
- source_labels: [__address__]
|
||||
regex: (\w+):(\w+):(.+)
|
||||
regex: ([^:]+):([^:]+):(.+)
|
||||
target_label: __param_module
|
||||
replacement: ${2}
|
||||
- source_labels: [__param_module]
|
||||
target_label: module
|
||||
- source_labels: [__address__]
|
||||
regex: (\w+):(\w+):(.+)
|
||||
regex: ([^:]+):([^:]+):(.+)
|
||||
target_label: __param_target
|
||||
replacement: ${3}
|
||||
- source_labels: [__param_target]
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes the regex used to match blackbox exporter targets in the
|
||||
``prometheus.yml.j2`` template to be less strict. Previously we were using
|
||||
``\w`` which did not allow for names with periods or hyphens. The service
|
||||
and module labels can now contain all characters except for a colon.
|
||||
Reference in New Issue
Block a user