[receiver/mysqlreceiver] Mysql receiver - Uint64 to Int64 overflow #35495
Description
Component(s)
receiver/mysql
What happened?
Description
User is hitting this error:
2024-09-12T10:05:08.788Z error scraperhelper/scrapercontroller.go:197 Error scraping metrics {"kind": "receiver", "name": "mysql/replica", "data_type": "metrics", "error": "sql: Scan error on column index 7, name "SUM_TIMER_FETCH": converting driver.Value type uint64 ("10607806269779284266") to a int64: value out of range; sql: Scan error on column index 7, name "SUM_TIMER_FETCH": converting driver.Value type uint64 ("10607806392347803736") to a int64: value out of range; failed to parse int64 for MysqlBufferPoolPages, value was 18446744073709551264: strconv.ParseInt: parsing "18446744073709551264": value out of range", "scraper": "mysql"}
Analysis
-
For
SUM_TIMER_FETCH
we can safely avoid the overflow, by settingtimeFetch
to uint64 and convert it back to int64 after the divisionopentelemetry-collector-contrib/receiver/mysqlreceiver/scraper.go
Lines 456 to 458 in 1d12566
-
For
MysqlBufferPoolPages
not sure if we even support uint64 and what options we have to send this value
Collector version
v0.110.0