Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prometheus-snmp-exporter] Support for multiple targets when using ServiceMonitor #1870

Merged
merged 1 commit into from
Mar 14, 2022
Merged

[prometheus-snmp-exporter] Support for multiple targets when using ServiceMonitor #1870

merged 1 commit into from
Mar 14, 2022

Conversation

tkit
Copy link
Contributor

@tkit tkit commented Mar 14, 2022

Signed-off-by: Taro Kitano unchemist@gmail.com

What this PR does / why we need it:

When using ServiceMonitor, it works even if there are multiple targets. This PR is inspired by the implementation of prometheus-blackbox-exporter:

In version 0.x, only a single snmp target works, as shown in the following issue.

To maintain compatibility as much as possible, I used existing keys, but version 0.x did not fundamentally support multiple targets, so I had to raise the major version.

Which issue this PR fixes

Special notes for your reviewer:

I have checked it in my environment and it works fine.

values.yaml:

serviceMonitor:
  enabled: true
  params:
    - name: device1
      target: 10.131.132.64
      interval: 40s
      scrapeTimeout: 40s
    - name: device2
      target: 10.131.132.65
      module: [dummy]
      labels:
        test: dummy
    - name: device3
      target: 10.131.132.66
    - name: device4
      target: 10.131.132.67
$ kubectl get servicemonitor -n monitor -l app.kubernetes.io/name=prometheus-snmp-exporter
NAME                               AGE
prometheus-snmp-exporter-device1   80m
prometheus-snmp-exporter-device2   80m
prometheus-snmp-exporter-device3   80m
prometheus-snmp-exporter-device4   80m

prometheus
prometheus

device2 is causing an error because it specifies a dummy module that does not exist.

grafana
grafana

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-couchdb-exporter])

…rviceMonitor

Signed-off-by: Taro Kitano <unchemist@gmail.com>
@monotek monotek merged commit 77514e9 into prometheus-community:main Mar 14, 2022
Zempashi pushed a commit to Zempashi/prometheus-helm-charts that referenced this pull request Mar 16, 2022
* [stable/kube-state-metrics] Add RBAC support

This commit adds RBAC support for stable/kube-state-metrics. RBAC comes
from https://github.com/kubernetes/kube-state-metrics/tree/v1.0.1/kubernetes.

* Bump chart version
@Saigut
Copy link

Saigut commented Nov 24, 2023

hello, way not support targets?
Like this:

serviceMonitor:
  enabled: true
  params:
    - name: devices
      targets:
        - 10.131.132.64
        - 10.131.132.65
        - 10.131.132.66
      interval: 40s
      scrapeTimeout: 40s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[prometheus-snmp-exporter] Multiple snmp targets could not be specified using ServiceMonitor
3 participants