Skip to content

[scraper/zookeeper] fix float parsing for zk_avg_latency on ZK 3.7+#47407

Open
vyagh wants to merge 2 commits intoopen-telemetry:mainfrom
vyagh:fix-zookeeper-avg-latency-float
Open

[scraper/zookeeper] fix float parsing for zk_avg_latency on ZK 3.7+#47407
vyagh wants to merge 2 commits intoopen-telemetry:mainfrom
vyagh:fix-zookeeper-avg-latency-float

Conversation

@vyagh
Copy link
Copy Markdown
Contributor

@vyagh vyagh commented Apr 7, 2026

Zookeeper 3.7+ reports zk_avg_latency as a float (e.g. 0.0989), which causes strconv.ParseInt to fail silently, dropping the zookeeper.latency.avg metric entirely.

Fall back to strconv.ParseFloat when ParseInt fails, truncating the result to int64 to match the existing metric schema.

Fixes #47320

@vyagh vyagh requested a review from a team as a code owner April 7, 2026 05:55
@vyagh vyagh requested a review from braydonk April 7, 2026 05:55
@github-actions github-actions bot added the first-time contributor PRs made by new contributors label Apr 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

@hkatkam-cyber
Copy link
Copy Markdown

@antonblock could you please review and approve it

@vyagh vyagh force-pushed the fix-zookeeper-avg-latency-float branch from 3ce8348 to e3c58b4 Compare April 9, 2026 04:43
@vyagh vyagh force-pushed the fix-zookeeper-avg-latency-float branch from e3c58b4 to 401c642 Compare April 9, 2026 04:59
@hkatkam-cyber
Copy link
Copy Markdown

@antonblock could you please review and approve it

@atoulme
Copy link
Copy Markdown
Contributor

atoulme commented Apr 20, 2026

@antonblock @akats7 please review as codeowners

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zookeeperreceiver: zookeeper.latency.avg not collected — strconv.ParseInt fails on float value from zk_avg_latency

4 participants