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] Issues converting floating value to int #38276

Open
atoulme opened this issue Feb 28, 2025 · 2 comments
Open

[receiver/mysql] Issues converting floating value to int #38276

atoulme opened this issue Feb 28, 2025 · 2 comments
Labels
bug Something isn't working receiver/mysql

Comments

@atoulme
Copy link
Contributor

atoulme commented Feb 28, 2025

Component(s)

receiver/mysql

What happened?

Description

With 0.119.0, the receiver shows errors:

"error": "sql: Scan error on column index 6, name \"SUM_TIMER_DELETE/1000\": converting driver.Value type []uint8 (\"0.0000\") to a int64: inva │
│ lid syntax; sql: Scan error on column index 3, name \"SUM_TIMER_WAIT/1000\": converting driver.Value type []uint8 (\"464493117.0000\") to a int64: invalid syntax; sql: Scan error on column index 12, name \"SUM_TIMER_READ_NORMAL/1000\" │
│ : converting driver.Value type []uint8 (\"0.0000\") to a int64: invalid syntax"}

Collector version

v0.119.0

Environment information

Environment

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

OpenTelemetry Collector configuration

Log output

Additional context

No response

@atoulme atoulme added bug Something isn't working needs triage New item requiring triage labels Feb 28, 2025
@ZaynJiang
Copy link

I also encountered this problem.

@devilcoolyue
Copy link
Contributor

Alright, I will submit a PR to fix this bug.
c c @atoulme

atoulme pushed a commit that referenced this issue Mar 11, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

the follow error log when use mysql receiver scrape metric:
2025-03-07T17:25:13.135+0800 error mysqlreceiver@v0.121.0/scraper.go:443
Failed to fetch table io_waits stats {"otelcol.component.id":
"mysql/mysqlv_1897931734926893056", "otelcol.component.kind":
"Receiver", "otelcol.signal": "metrics", "error": "sql: Scan er
ror on column index 6, name \"SUM_TIMER_DELETE/1000\": converting
driver.Value type []uint8 (\"0.0000\") to a int64: invalid syntax"}

github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver.(*mySQLScraper).scrapeTableIoWaitsStats

github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver@v0.121.0/scraper.go:443

github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver.(*mySQLScraper).scrape

github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver@v0.121.0/scraper.go:90
go.opentelemetry.io/collector/scraper.ScrapeMetricsFunc.ScrapeMetrics
go.opentelemetry.io/collector/scraper@v0.121.0/metrics.go:24

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

issue #38276 

<!--Describe what testing was performed and which tests were added.-->
#### Testing

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

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Sean Marciniak <30928402+MovieStoreGuy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working receiver/mysql
Projects
None yet
Development

No branches or pull requests

3 participants