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

[receiver] mysql - Replication Metrics don't report before version 8.0.22 #35217

Closed
StefanKurek opened this issue Sep 16, 2024 · 1 comment · Fixed by #35776
Closed

[receiver] mysql - Replication Metrics don't report before version 8.0.22 #35217

StefanKurek opened this issue Sep 16, 2024 · 1 comment · Fixed by #35776
Labels
bug Something isn't working needs triage New item requiring triage receiver/mysql

Comments

@StefanKurek
Copy link
Contributor

Component(s)

receiver/mysql

What happened?

Description

The MySQL Receiver will only report replication metrics if connected to MySQL version 8.0.22 or greater. This is due to the change from SHOW SLAVE STATUS to SHOW REPLICA STATUS. When these replication metrics were added, they were only added for the latter case. And when bugs were noticed, the fix was to just have the client do nothing when the MySQL version is < 8.0.22. Instead the alternate query could be used and additional entries could be added to the switch case statement based on this table (I can't actually find 8.0 documentation anymore...not sure if it exists).

Steps to Reproduce

Connect MySQL Receiver to a MySQL Server version 8.0 (any version less than 8.0.22) setup with replication and collect metrics.

Expected Result

See replication metrics coming back.

Actual Result

No metrics come back (although other metrics come back just fine).

Collector version

v0.109.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

receivers:
  mysql:
    endpoint: localhost:3306
    username: user
    password: pass
    database: otel
    collection_interval: 1m

Log output

No response

Additional context

No response

@StefanKurek StefanKurek added bug Something isn't working needs triage New item requiring triage labels Sep 16, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

sbylica-splunk pushed a commit to sbylica-splunk/opentelemetry-collector-contrib that referenced this issue Dec 17, 2024
…-telemetry#35776)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Version of MySQL older than 8.0.22 use the `show slave status` vs `show
replica status` view to retrieve replication metrics. This allows for
both the newer & older views to work and retrieve data for the two
actual replica metrics available (`mysql.replica.time_behind_source` &
`mysql.replica.sql_delay`).

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#35217

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Manual testing against MySQL versions 8.0, 8.0.37, & MariaDB Ver 15.1
Distrib 10.5.26-MariaDB

<!--Describe the documentation added.-->
#### Documentation
None needed

<!--Please delete paragraphs that you did not use before submitting.-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage receiver/mysql
Projects
None yet
1 participant