1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 03:38:43 +00:00

Merge pull request from mikechengwei/feature/addtmplabel

This commit is contained in:
Paweł Krupa 2022-02-28 12:48:03 +01:00 committed by GitHub
commit 2e849ffe21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -1078,6 +1078,14 @@ func (cg *ConfigGenerator) generateProbeConfig(
// Relabelings for prober.
relabelings = append(relabelings, []yaml.MapSlice{
{
{Key: "source_labels", Value: []string{"__tmp_prometheus_address"}},
{Key: "separator", Value: ";"},
{Key: "regex", Value: "(.*)"},
{Key: "target_label", Value: "__tmp_prometheus_address"},
{Key: "replacement", Value: "$1"},
{Key: "action", Value: "replace"},
},
{
{Key: "source_labels", Value: []string{"__param_target"}},
{Key: "target_label", Value: "instance"},

View file

@ -1001,6 +1001,13 @@ scrape_configs:
- source_labels:
- __meta_kubernetes_ingress_name
target_label: ingress
- source_labels:
- __tmp_prometheus_address
separator: ;
regex: (.*)
target_label: __tmp_prometheus_address
replacement: $1
action: replace
- source_labels:
- __param_target
target_label: instance
@ -1132,6 +1139,13 @@ scrape_configs:
- source_labels:
- __meta_kubernetes_ingress_name
target_label: ingress
- source_labels:
- __tmp_prometheus_address
separator: ;
regex: (.*)
target_label: __tmp_prometheus_address
replacement: $1
action: replace
- source_labels:
- __param_target
target_label: instance