mysqd_exporter - Monitor multiple database hosts with one exporter

2,319 views
Skip to first unread message

Aidan Wong

unread,
Nov 6, 2017, 1:24:47 PM11/6/17
to Prometheus Users
Hi,

Has anyone been successful to monitor multiple database hosts with one mysqld exporter?


Thanks 

Ben Kochie

unread,
Nov 6, 2017, 1:27:35 PM11/6/17
to Aidan Wong, Prometheus Users
No, it is an intentional design for the exporter to be one-to-one colocated on localhost with each mysqld.  This is typical of most Prometheus exporters.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/a82ec52c-18f0-475e-8582-d5605178e15a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aidan Wong

unread,
Nov 6, 2017, 2:56:58 PM11/6/17
to Ben Kochie, Prometheus Users
Hi Ben,

I don't think the mysqld_exporter needs to be running colocated with local host running MySQL since it has the ability to take a $DATA_SOURCE_NAME
export DATA_SOURCE_NAME='login:password@(hostname:port)/'
./mysqld_exporter <flags>
I was wondering if anyone has used the mysqld_exporter as a monitoring "proxy" to multiple mysql database hosts which would be useful of AWS RDS instances where you cannot install mysqld_exporter to local hosts running MySQL.

Ben Kochie

unread,
Nov 6, 2017, 4:11:26 PM11/6/17
to Aidan Wong, Prometheus Users
It doesn't need to, but that is the intended design.

Amazon RDS instances are a good example of an exception to this normal design.  Maybe we should file a feature request with Amazon to support Prometheus metrics. natively. :-)

Unfortunately, the only current method supported is to run several exporters on different ports.

It would be possible to adapt the mysqld_exporter code to make it into a proxy, but this is not something I have the spare time to support.

We recently refactored the mysqld_exporter's collector code to make it easier to use the collectors as a library to create customized exporters if you're interested in making one.

Aidan Wong

unread,
Nov 7, 2017, 4:36:01 PM11/7/17
to Ben Kochie, Prometheus Users
Thank you Ben, I'll make an attempt to have an exporter "proxy" integration.  Can you think of any exiting exporters that may have something similar integrated?



Ben Kochie

unread,
Nov 8, 2017, 3:16:18 AM11/8/17
to Aidan Wong, Prometheus Users
Both the snmp and blackbox exporters are proxy style.  They expose a separate http endpoint named /snmp and /probe (respectively) that take a target= URL parameter.

I highly recommend following the pattern they use to put the authentication credentials in the config file, and alias them into a 'module' param.  This avoids leaking credentials in the rest of the monitoring chain.

Then the config would contain something like:

---
prod:
  username: exporter
  password: extrasecret
staging:
  username: exporter
  password: testingpassword

Then you would have a final URL like:

http://exporter:port/mysqld?module=prod&target=prod-rds-server.example.com:3306

Akadi Icho

unread,
Mar 22, 2018, 10:27:27 AM3/22/18
to Prometheus Users
Hi there,
can anyone help with the installation of the MySQL Server Exporter on windows. 

redi...@gmail.com

unread,
Apr 2, 2019, 2:16:01 AM4/2/19
to Prometheus Users
is there any update on this question? I think current prometheus 1:1 solution does not work on cloud, on which applications do not have any control.

Ben Kochie

unread,
Apr 2, 2019, 4:51:55 AM4/2/19
to redi...@gmail.com, Prometheus Users
Maybe you should talk to your cloud provider about providing metrics as part of their service.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/cdc98ec5-f27c-4cdb-89b6-3d20b130aa1d%40googlegroups.com.

woosley. xu.

unread,
Apr 4, 2019, 4:25:08 AM4/4/19
to Ben Kochie, Prometheus Users
well, we don't control cloud, and all cloud providers, including AWS at the moment, provide not enough detailed metrics for RDS

Ben Kochie <sup...@gmail.com> 于2019年4月2日周二 下午4:51写道:


--
woosley.xu.    http://twitter.com/redicaps


Ben Kochie

unread,
Apr 4, 2019, 6:57:24 AM4/4/19
to woosley. xu., Prometheus Users
You're right, but have you talked to them about it? If you don't ask for it, it won't change.
Reply all
Reply to author
Forward
0 new messages