swarmprom
swarmprom copied to clipboard
Not able to monitor 3rd party exporters
Hi Stefan,
I tried to follow the "https://github.com/stefanprodan/swarmprom#monitoring-applications-and-backend-services" to monitor kafka and MySQL services using Prometheus provided exporters for these tools.
Eg. this one for MySQL https://github.com/prometheus/mysqld_exporter
I configured this in docker-compose file
environment:
- JOBS=kafka-exporter:9308 mysql-exporter:9104
Now I can see the metrics from the web browser. But my Prometheus is not scraping any metrics from them.
So I have some confusion here.
- I 've attached these exporter containers to my mon_net network. But I started them with the docker run command, do I need to start with them with stack?
- If I want to use the blackbox exporter which needs much more arguments than the exporter name and port how do I pass them to the container? given that I can't edit the Prometheus.yml file.
Thanks for the help.
Regards, Ashish
Hi Ashish
Where in the docker-compose file did you enter that environment. If you could share your edits it would be greatly appreciated.
Hi @ashish235, your post helped me in a way, but what i added to make prometheus scrap my data, is to add a job in prometheus/conf/prometheus.yml
docker-compose.yml
file, add:
prometheus:
image: stefanprodan/swarmprom-prometheus:v2.2.0-rc.0
environment:
- JOBS=sts-exporter:9913
prometheus/conf/prometheus.yml
file, add:
- job_name: 'nginx'
static_configs:
- targets: ['sts-exporter']
sts-exporter is a service running on the same overlay network as swarmprom
for me i created an overlay network using docker network create --drive overlay attachable appnet
and changed docker-compose.yml of swarmprom to use the external network,