Prometheus collector query defined once, applied everywhere


I'm using Metricbeat 8.6.2 and I'm trying to collect Prometheus metrics using the official Prom snmp exporter. This particular exporter requires passing a URL query string to configure the snmp endpoint to collect the metrics from.

As an example, this exporter URL: http//snmpexporter:9116/snmp/?target= makes the snmp exporter return snmp metrics from IP and the synology MIB module.

Here is a sample configuration which collects Prometheus metrics from 2 different exporters:

  • the SNMP exporter (see above for details) with configured as the snmp target
  • the embedded Canonical MaaS exporter running on host
  - module: prometheus
    period: 30s
    metricsets: ["collector"]
    hosts: ["snmpexporter:9116"]
    metrics_path: /snmp
      module: synology
  - module: prometheus
    period: 30s
    metricsets: ["collector"]
    hosts: [""]
    use_types: true
    rate_counters: false
    metrics_path: /MAAS/metrics

The issue is that the query parameter which is defined only in the first Prometheus module configuration (snmp), is also applied transparently to the second Prometheus configuration (MaaS). See:

Defining an empty query parameter for the second Prometheus configuration does not help much (and would not be a scalable solution when using autodiscover and hints autodiscover)

Any idea what's wrong with my configuration?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.