fix(eot): report None detection_delay when client timestamp is unset#6494
Open
dhanavanthesh wants to merge 1 commit into
Open
fix(eot): report None detection_delay when client timestamp is unset#6494dhanavanthesh wants to merge 1 commit into
dhanavanthesh wants to merge 1 commit into
Conversation
An unset latest_client_created_at reads back as epoch 0, so `now - 0` reported a detection_delay of roughly 56 years. Guard the calculation with the same `> 0` check used by _warn_transport_latency and report None when the timestamp is unknown. EOTInferenceMetrics.detection_delay is now float | None. Add a regression test for the unset case with a normal-timestamp control.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the server doesn't set
latest_client_created_at, the protobuf timestamp reads back as epoch 0.That made
detection_delay = now - 0, so a missing timestamp could report a delay of roughly 56 years.The agent behavior is unaffected, but that bad value can leak into EOT metrics and latency traces.
Before:
After:
The fix uses the same
request_sent_at_ms > 0guard already used by_warn_transport_latency.EOTInferenceMetrics.detection_delayis nowfloat | None, so metrics handlers should handleNonefor this unknown case.Includes a regression test for the unset case and a normal-timestamp control.