Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-target support not working as described in README.md #685

Closed
magiclobster opened this issue Nov 28, 2022 · 2 comments
Closed

Multi-target support not working as described in README.md #685

magiclobster opened this issue Nov 28, 2022 · 2 comments

Comments

@magiclobster
Copy link

Multi-target scraping is not working as described

Host operating system: output of uname -a

official debian-bullseys docker image
Linux aa8c1b0705ce 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) x86_64 GNU/Linux

mysqld_exporter version: output of mysqld_exporter --version

mysqld_exporter, version 0.14.0 (branch: HEAD, revision: ca1b9af)
build user: root@401d370ca42e
build date: 20220304-16:25:15
go version: go1.17.8
platform: linux/amd64

MySQL server version

mysqld_exporter command line flags

None, .my.cnf placed in home directory

.my.cnf configuration

[client]
user=monitoring
password=xXx

[client.servers]
user=monitoring
password=xXx

What did you do that produced an error?

curl http://127.0.0.1:9104/probe?target=hostname:3306
curl http://127.0.0.1:9104/probe?target=hostname:3306&auth_module=client
curl http://127.0.0.1:9104/metrics?target=hostname:3306
curl http://127.0.0.1:9104/metrics?target=hostname:3306&auth_module=client

What did you expect to see?

mysql metrics

What did you see instead?

when using the /metrics endpoint only the exporter metrics are shown
mysql_exporter logs the following:
caller=exporter.go:149 level=error msg="Error pinging mysqld" err="dial tcp 127.0.0.1:3306: connect: connection refused"

When putting host=hostname and port=3306 into .my.cnf i can scrape the single node without problems.

Is multi target scraping working?
What is the correct endpoint? /probe as stated in the README doesn't work.
/metrics endpoint works but does not read the target url parameter

can somebody give me a hint please :)

@nthienan
Copy link

@magiclobster you have to compile mysqld_exporter from the source code yourself. Please don't use the latest release. That version is not supported multi-targets yet.

@magiclobster
Copy link
Author

magiclobster commented Nov 29, 2022

Thank you @nthienan
Works like a charm

FROM golang:1.18-bullseye as builder

RUN apt-get update && apt-get install -y \
        build-essential \
        g++ \
        make \
        git \
        mariadb-server

RUN mkdir /build \
  && cd /build \
  && git clone https://github.com/prometheus/mysqld_exporter \
  && cd /build/mysqld_exporter

RUN service mariadb start \
    && mysql -u root -e "CREATE OR REPLACE USER 'root'@'localhost' IDENTIFIED BY ''; GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES;" \
    && cd /build/mysqld_exporter \
    && make

COPY --from=builder /build/mysqld_exporter/mysqld_exporter /usr/local/bin

Now it works like described :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants