snmp_exporter icon indicating copy to clipboard operation
snmp_exporter copied to clipboard

helm chart: ServiceMonitor is not created

Open stefanpinterBE opened this issue 3 years ago • 1 comments

hi!

i tried installing snmp exporter via helm chart to make it work with prometheus-operator. for that I fetched the values with "helm show values" and set this to true and set the namespace to "default"

serviceMonitor:
  enabled: false
  namespace: monitoring

helm install doesn't show any errors... it just seems to ignore that I enabled the serviceMonitor

I suppose i need some other settings but I did not find an easy template for doing that sadly

is this a bug or did I do it completly wrong?

thank you!

Host operating system: output of uname -a

5.19.0-051900-generic shrug

snmp_exporter version: output of snmp_exporter -version

0.19.0, branch=HEAD, revision=9dcbc02f59648b21fcf632de1b62a30df70f4649

What device/snmpwalk OID are you using?

none yet

If this is a new device, please link to the MIB(s).

yes and no

What did you do that produced an error?

running this helm upgrade --install snmpexporter -f prometheus-operator/prometheus-snmp-exporter.config.yaml prometheus-community/prometheus-snmp-exporter --debug

What did you expect to see?

seeing snmp exporter in ServiceMonitors

What did you see instead?

the default servicemonitors installed by prometheus-operator helm chart

stefanpinterBE avatar Jan 18 '23 15:01 stefanpinterBE

ah, it is working now! it created the ServiceMonitor resource now. i realized, that the ServiceMonitor configuration is until the end of the values file and I didn't realize that before...

so basically this is my dummy config that made it work

serviceMonitor:
  enabled: true
  namespace: default
  path: /snmp
  scrapeTimeout: 10s
  module:
    - if_mib
  additionalMetricsRelabels: {}
  selector:
    release: prometheus
  honorLabels: true

  params:
    - name: localhost                 # Human readable URL that will appear in Prometheus / AlertManager
      target: 127.0.0.1               # The target that snmp will scrape
      module:                         # Module used for scraping. Overrides value set in `serviceMonitor.module`
        - if_mib
      labels: {}                      # Map of labels for ServiceMonitor. Overrides value set in `serviceMonitor.selector`
      interval: 30s                   # Scraping interval. Overrides value set in `serviceMonitor.interval`
      scrapeTimeout: 30s              # Scrape timeout. Overrides value set in `serviceMonitor.scrapeTimeout`
      relabelings: []                 # MetricRelabelConfigs to apply to samples before ingestion. Overrides value set in `serviceMonitor.relabelings`
      additionalMetricsRelabels: {}   # Map of metric labels and values to add


stefanpinterBE avatar Jan 18 '23 15:01 stefanpinterBE

For questions/help/support please use our community channels. There are more people available to potentially respond to your request and the whole community can benefit from the answers provided.

SuperQ avatar May 11 '24 10:05 SuperQ