Advertisement
adathor

Prometheus+Thanos - metrics collection

Feb 9th, 2023
1,165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.08 KB | None | 0 0
  1. ## Config for other clusters
  2. prometheus:
  3.   enabled: true
  4.   prometheusSpec:
  5.     disableCompaction: false
  6.     replicas: 1
  7.     retention: 90d
  8.     externalLabels:
  9.       geo: eu
  10.       region: west4
  11.       cluster: staging
  12.     image:
  13.       repository: prometheus/prometheus
  14.       tag: v2.41.0
  15.     thanos:
  16.       tag: v0.30.1
  17.       objectStorageConfig:
  18.         key: thanos_gcs.yml
  19.         name: thanos-gcs-storage
  20.     additionalArgs:
  21.     - name: storage.tsdb.min-block-duration
  22.       value: 5m    
  23.     - name: storage.tsdb.max-block-duration
  24.       value: 5m
  25.     additionalScrapeConfigs:
  26.     - job_name: 'kubernetes-service-endpoints'
  27.       honor_labels: true
  28.       kubernetes_sd_configs:
  29.       - role: endpoints
  30.       relabel_configs:
  31.        # select only those endpoints whose service has "prometheus.io/scrape: true" annotation
  32.         - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]
  33.           action: keep
  34.           regex: true
  35.         # set the metrics_path to the path specified in "prometheus.io/path: <metric path>" annotation.
  36.         - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]
  37.           action: replace
  38.           target_label: __metrics_path__
  39.           regex: (.+)
  40.         # set the scrapping port to the port specified in "prometheus.io/port: <port>" annotation and set address accordingly.
  41.         - source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port]
  42.           action: replace
  43.           target_label: __address__
  44.           regex: ([^:]+)(?::\d+)?;(\d+)
  45.           replacement: $1:$2
  46.         - action: labelmap
  47.           regex: __meta_kubernetes_service_label_(.+)
  48.         - source_labels: [__meta_kubernetes_namespace]
  49.           action: replace
  50.           target_label: kubernetes_namespace
  51.         - source_labels: [__meta_kubernetes_service_name]
  52.           action: replace
  53.           target_label: kubernetes_name
  54. alertmanager:
  55.   enabled: true
  56.   alertmanagerSpec:
  57.     image:
  58.       repository: prometheus/alertmanager
  59.       tag: v0.25.0
  60. grafana:
  61.   enabled: false
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement