prometheus-operator / kube-prometheus

Use Prometheus to monitor Kubernetes and applications running on Kubernetes

Home Page:https://prometheus-operator.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to add new relabel_configs and metric_relabel_configs for job_name monitoring/kube-state-metrics/0 and job_name monitoring/kube-state-metrics/1

zyz-1998 opened this issue · comments

example
new add one relabel_config
`

  • job_name: 'kube-state-metrics/0'
    honor_labels: true
    static_configs:
    • targets:
      • 'kube-state-metrics:8080'
        metric_relabel_configs:
    • source_labels: [label_app]
      action: replace
      target_label: sys_name
      regex: '(.)'
      replacement: '${1}'
      action: labelmap
      regex: '.
      '
      regex: label_app=(.*)
      replacement: '${1}'
      file_sd_configs:
    • files:
      • /etc/prometheus/configmaps/*.json
        relabel_configs:
    • source_labels: [__meta_kubernetes_configmap_name]
      action: keep
      regex: cmdb-config
      {
      "tip-flw": "test_module_one",
      "tip-fle": "test_modeule_two"
      }
      `

Is this scenario unable to be solved through kube-prometheus? What methods can you recommend? Thank you.