Skip to content

fix(receiver/httpcheck): report timing metrics as float64 to preserve sub-millisecond precision#47718

Open
himanshu130700 wants to merge 2 commits intoopen-telemetry:mainfrom
himanshu130700:fix/47257-httpcheck-timing-metrics-zero
Open

fix(receiver/httpcheck): report timing metrics as float64 to preserve sub-millisecond precision#47718
himanshu130700 wants to merge 2 commits intoopen-telemetry:mainfrom
himanshu130700:fix/47257-httpcheck-timing-metrics-zero

Conversation

@himanshu130700
Copy link
Copy Markdown
Contributor

Fixes #47257

Previously, getDurations() used integer division (ns / int64(time.Millisecond))
which truncated any phase duration under 1ms to 0. On fast local/Docker networks,
all five phase timings (DNS, TCP connect, TLS handshake, request write, response
read) are typically sub-millisecond, causing the metrics to always report 0.

Fix by changing the five affected timing metrics to value_type: double in
metadata.yaml and using float64 division in getDurations(), so e.g. a 500µs
DNS lookup is correctly reported as 0.5ms instead of 0ms.

@himanshu130700 himanshu130700 requested a review from a team as a code owner April 17, 2026 17:45
@github-actions github-actions bot added the receiver/httpcheck HTTP Check receiver label Apr 17, 2026
@github-actions github-actions bot requested a review from VenuEmmadi April 17, 2026 17:45
@himanshu130700 himanshu130700 force-pushed the fix/47257-httpcheck-timing-metrics-zero branch 2 times, most recently from f3179db to 511650a Compare April 17, 2026 17:56
@himanshu130700 himanshu130700 force-pushed the fix/47257-httpcheck-timing-metrics-zero branch from 511650a to f1acef6 Compare April 17, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

receiver/httpcheck HTTP Check receiver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/httpcheck]

2 participants