Skip to content

Commit 7d2d31c

Browse files
Martin Linkhorstmikkeloscar
authored andcommitted
loadtest prometheus ipv6 pod support similar to ce6f3fe
1 parent 1d504de commit 7d2d31c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/e2e/loadtest/client/prom-configmap.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,18 @@ data:
5757
action: replace
5858
target_label: __metrics_path__
5959
regex: (.+)
60+
# If __address__ is ipv6, update ipv6 adress with []
61+
# https://github.com/prometheus/prometheus/issues/14656
62+
- source_labels: [__address__]
63+
regex: '\[?([0-9a-fA-F:]+:[0-9a-fA-F:]+)\]?(:\d+)?'
64+
action: replace
65+
target_label: __address__
66+
replacement: '[$1]$2'
6067
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
6168
action: replace
62-
regex: ([^:]+)(?::\d+)?;(\d+)
63-
replacement: $1:$2
69+
# match both ipv6 and ipv4
70+
regex: ([0-9.]+|\[?[0-9a-fA-F:]+\]?)(:?\d+)?;(\d+)
71+
replacement: $1:$3
6472
target_label: __address__
6573
- action: replace
6674
source_labels: ['__meta_kubernetes_pod_ip']

0 commit comments

Comments
 (0)