Skip to content

Commit

Permalink
Added k8 test back
Browse files Browse the repository at this point in the history
  • Loading branch information
okankoAMZ committed Oct 14, 2024
1 parent 92a30ad commit 6bf6530
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions receiver/prometheusreceiver/testdata/config_k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
prometheus:
config:
scrape_configs:
- job_name: apps
kubernetes_sd_configs:
- role: pod
selectors:
- role: pod
# only scrape data from pods running on the same node as collector
field: "spec.nodeName=${NODE_NAME}"
relabel_configs:
# scrape pods annotated with "prometheus.io/scrape: true"
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
regex: "true"
action: keep
# read the port from "prometheus.io/port: <port>" annotation and update scraping address accordingly
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
target_label: __address__
regex: ([^:]+)(?::\d+)?;(\d+)
# escaped $1:$2
replacement: $$1:$$2
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: kubernetes_namespace
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: kubernetes_pod_name

0 comments on commit 6bf6530

Please sign in to comment.