kube-prometheus icon indicating copy to clipboard operation
kube-prometheus copied to clipboard

Adding relabel for every static in staticConfig of Probe

Open P9os opened this issue 2 years ago • 0 comments

What is missing? We use Probe for collect data from SNMP targets, and have only IP address label. Why do we need it? Ability to add label for every static target in Probe CRD, like us prometheus config yaml

- job_name: 'development'
    static_configs:
      - targets: [ '192.168.1.1:9100' ]
        labels:
          service: '1'
      - targets: [ '192.168.1.1:9101' ]
        labels:
          service: '2'

Environment K8s v1.22.8

  • Prometheus Operator version: quay.io/prometheus-operator/prometheus-operator:v0.58.0

Anything else we need to know?: Suggest model like as:

apiVersion: monitoring.coreos.com/v1
kind: Probe
metadata:
  name: test-exporter
spec:
  interval: 60s
  prober:
    path: /probe
    url: test-exporter.default.svc.cluster.local:8080
  targets:
    staticConfig:
      static:
        - address: 10.15.12.220
          labels:
            - device: device/1
            - os: centos
        - address: 10.15.12.221
          labels:
            - device: device/18
            - os: ubuntu
        - address: 10.15.12.222
          labels:
           - device: device/12
           - os almalinux

Thanks

P9os avatar Oct 25 '22 14:10 P9os