-
Notifications
You must be signed in to change notification settings - Fork 444
Open
Description
Describe the bug
Noobie here.
I successfully setup multi-target MongoDB exporter and got metrics by target URL in Prometheus but there is no data in Grafana dashboards. Used this and this one.
To Reproduce
Steps to reproduce the behavior:
- Setup docker-compose.yml:
---
services:
mongodb_exporter:
image: percona/mongodb_exporter:0.43.1
container_name: mongodb_exporter
cpus: 0.5
mem_limit: 200m
env_file:
- .env
networks:
- caddy
networks:
caddy:
external: true
- In
.env
, set hosts to collect data from as following:
MONGODB_URI=mongodb+srv://user:password@cluster6.9texege.mongodb.net/admin
- Add Prometheus config record:
- job_name: MongoDB
file_sd_configs:
- files:
- /etc/file_sd/mongodb_targets_custom.yml
refresh_interval: 30s
- Setup
mongodb_targets_custom.yml
:
- targets:
- mongodb_exporter:9216
labels:
__metrics_path__: /scrape
__param_target: cluster6.9texege.mongodb.net
- See green
🟩 UP
status in Prometheus and check metrics manually by HTTP:
/ # wget -O- http://mongodb_exporter:9216/scrape?target=cluster6.9texege.mongodb.net | tail -n 12
Connecting to mongodb_exporter:9216 (172.18.0.13:9216)
writing to stdout
- 100% |**************************************************| 8471 0:00:00 ETA
written to stdout
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 2.8643328e+07
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.73835338716e+09
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 1.279807488e+09
# HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes.
# TYPE process_virtual_memory_max_bytes gauge
process_virtual_memory_max_bytes 1.8446744073709552e+19
Expected behavior
I should see some bars, charts and data regardless of selected filters.
Actual behavior
All data is void.
Environment
- MongoDB exporter 0.43.1
- Ubuntu 24.04
- Docker the latest
- MongoDB version 8.0.4