This has been mentioned before here:
But as there is no resolution there I'm posting here and will open an issue on github shortly. With the Prometheus module if you define 2 items that leverage the module, metricbeat (as a result of composing it seems) merges it and causes invalid queries to result. In my case this is scraping a rook-ceph instance and a custom vsphere exporter:
prometheus-rook-ceph.yml
# Module: prometheus
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/8.4/metricbeat-metricset-prometheus-remote_write.html
- module: prometheus
metrics_path: /metrics
period: 30s
hosts: ["rook-ceph-mgr.rook-ceph:9283"]
tags: ["prometheus"]
processors:
- add_fields:
target: ''
fields:
type: 'ceph-prometheus'
site: "${SITE}"
prometheus-vmware-exporter.yml
# /usr/share/metricbeat/modules.d/
# Module: prometheus
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/8.4/metricbeat-metricset-prometheus-remote_write.html
- module: prometheus
metrics_path: /metrics
query:
vsphere_host: "dev-esxi01.mydomain.net"
period: 30s
hosts: ["vmware-exporter:9272"]
tags: ["prometheus"]
processors:
- add_fields:
target: ''
fields:
type: 'vmware-exporter'
site: "${SITE}"
The expected behavior is that metricbeat scrapes each endpoint individually. What actually happens is the configs are errantly merged in some way resulting in errantly querying the bare /metrics endpoint for ceph mgr:
http://rook-ceph-mgr.rook-ceph:9283/metrics?vsphere_host=dev-esxi01.mydomain.net