Repository navigation
feat(api): log the phases of every Cloudflare Realtime call - #790
Merged
Merged
Conversation
Each add-tracks, renegotiate, close and session-create call now logs one cloudflare_sfu.call_trace line with dns_ms, connect_ms, tls_ms, ttfb_ms, conn_reused, conn_idle_ms, the IP family, the 3-letter Cloudflare colo, the operation, pull or publish, and the track count. No behavior changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…at warn, classify capture pulls - body_ms covers the wait between the first response byte and the end of the body. - A failed dial still stamps connect_ms, so a connect timeout shows its length. - A failed call logs its trace at warn, so it survives CHALK_API_LOG_LEVEL=warn. - Recording pulls (captureTracksRequest) log their kind and track count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cels at info Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Slow Cloudflare Realtime calls (add tracks, renegotiate, close, session create) cannot be explained from our logs today: we log the total time, not where it went. This adds one log line per call so the next production data shows whether a slow call lost time in DNS, connect, TLS, a stale reused connection or Cloudflare itself.
Fix
cloudflare_sfu.call_tracewithdns_ms,connect_ms,tls_ms,ttfb_ms(request sent to first response byte),conn_reused,conn_idle_ms,ip_family(v4orv6),colo(the 3-letter suffix of thecf-rayheader),operation,kind(pull,publish,mixed, or empty for calls without tracks),track_countandhttp_status.http_status0 andttfb_ms0.cloudflare_sfu.add_tracksline.http_status,provider_code,provider_raw_code), so nothing was added there.httptrace.Proof
call_trace_test.gouses a fake Cloudflare that sets acf-rayheader and delays 60 ms. It checks the exact field set,coloFRA,ip_familyv4,ttfb_msnear the delay,conn_reusedfalse then true on the second call, and that the ray ID and server address are absent from the log. Other tests cover a call with no answer, the colo parser (lowercase, padding, missing, too long) and the v4/v6 family.go testforadapters/cloudflare/...andhttpapi/...passes on Instabox. The pre-commit gate passed.tls_msis covered only by the zero case.Undo: revert this commit; nothing else depends on the log line.
Created with Claude Sonnet 5.5 in Claude Code.