Skip to content

fix(relay): export tunnel cleanup counters to Axiom - #13528

Merged
juliusmarminge merged 2 commits into
mainfrom
t3code/relay-cron-axiom-spans
Sep 25, 2026
Merged

juliusmarminge merged 2 commits into
mainfrom
t3code/relay-cron-axiom-spans

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

The relay's five-minute cron ran without the Axiom tracer, and the tunnel reaper only logged its counters to the Worker console. The dry-run step of the managed tunnel cleanup rollout (#9386) exists so we can read those counters over several sweeps, and right now they only show up in live Worker logs.

The cron job now gets the same Axiom tracer as HTTP requests, and each sweep records its result on the relay.managed_endpoint_reaper.sweep span as relay.managed_endpoint_reaper.* attributes (mode, scanned, wouldDelete, skippedLegacy, skippedOrphan, deleted, failed, truncated, listRequests, attempted). The exporter's scope finalizer flushes spans before the scheduled run ends.

With cleanup off, the sweep returns immediately, so each run adds one near-empty cron span and one sweep span to the traces dataset.

Verification: relay typecheck, scoped lint, and format pass. ManagedEndpointReaper.test.ts passes (18 tests), including a new test that records the span and checks the dry-run counters. That test fails when the annotation is removed.

🤖 Generated with Claude Code


Devin Review

Summary by CodeRabbit

  • Improvements
    • Relay monitoring now reports managed endpoint sweep mode and results, including the number of endpoints scanned, deletion outcomes, and legacy endpoints skipped.
    • Traces for the scheduled relay task are now sent to the configured tracing system.
    • Dry-run sweeps report which tunnels would be deleted while leaving all tunnels unchanged.

The cron job ran without the Axiom tracer, and the reaper only logged its
counters to the Worker console. The dry-run rollout step has no durable place
to read them. Provide the relay tracer to the cron job and record each sweep's
counters as attributes on its span.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 25, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 25, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR adds cleanup counters to an existing span and enables Axiom tracing for the production five-minute cron, including external export and flushing before the run ends. Because this activates non-trivial telemetry work on an existing production path, human review is warranted.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.5 KiB 13.5 KiB −32 B (−0.2%) 15.1 KiB ✅
Codex Thread snapshot wire 7.1 KiB 7.1 KiB +2 B (+0.0%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.5 KiB 6.4 KiB −34 B (−0.5%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 56.3 KiB 56.2 KiB −44 B (−0.1%) 66.4 KiB ✅
Codex Live turn messages 10 9 −1 (−10.0%) 21 ✅
Claude Total thread wire 13.5 KiB 13.5 KiB +22 B (+0.2%) 15.1 KiB ✅
Claude Thread snapshot wire 7.1 KiB 7.1 KiB +4 B (+0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.4 KiB 6.4 KiB +18 B (+0.3%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 57.0 KiB 57.0 KiB 0 B (0.0%) 66.4 KiB ✅
Claude Live turn messages 9 9 0 (0.0%) 21 ✅

Baseline: 9c524d5 · PR result: 015a47d · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 114.0 KiB
  • Claude decoded thread snapshot: 114.7 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: aee3fa9c-fe66-4791-85fa-bd14a1adb3c1

📥 Commits

Reviewing files that changed from the base of the PR and between 0abcc09 and 015a47d.

📒 Files selected for processing (1)
  • infra/relay/src/worker.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The relay cron task provides relay tracing. The managed endpoint sweep adds its mode and result counters to the current span. A dry-run test checks the span attributes and confirms that no tunnels are deleted.

Changes

Managed endpoint sweep tracing

Layer / File(s) Summary
Trace the scheduled sweep and verify attributes
infra/relay/src/worker.ts, infra/relay/src/environments/ManagedEndpointReaper.ts, infra/relay/src/environments/ManagedEndpointReaper.test.ts
The cron task provides relayTraceLayer. The sweep annotates its span with its mode and result counters. The dry-run test checks these attributes and confirms that no tunnels are deleted.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to 015a4

The scheduled sweep now runs with relay tracing, and successful cleanup counters are recorded on its span. The supplied source evidence shows the tracing scope and counter path are wired together; no actionable merge risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: exporting tunnel cleanup counters to Axiom through relay tracing.
Description check ✅ Passed The description explains what changed, why it changed, implementation details, and verification results. It does not use the template headings or include the checklist, but the required information is…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@macroscopeapp
macroscopeapp Bot dismissed their stale review September 25, 2026 00:53

Dismissing prior approval to re-evaluate 015a47d

@juliusmarminge
juliusmarminge merged commit d23eab1 into main Sep 25, 2026
24 checks passed
@juliusmarminge
juliusmarminge deleted the t3code/relay-cron-axiom-spans branch September 25, 2026 01:10
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 25, 2026
## What's Changed
* fix(web): sidebar Back always returns to the main app by @t3dotgg in pingdotgg/t3code#13516
* fix(desktop): desktop updates reconnect in seconds, not minutes by @t3dotgg in pingdotgg/t3code#12006
* fix(connect): remove tunnels after hosts go offline by @t3dotgg in pingdotgg/t3code#9386
* fix(mobile): capture a lit 6.9-inch lock screen in the agent-activity showcase by @juliusmarminge in pingdotgg/t3code#13522
* feat(grok): offer one-click updates through `grok update` by @juliusmarminge in pingdotgg/t3code#13523
* fix(mobile): make Android subscription usage widgets scrollable by @tris203 in pingdotgg/t3code#13474
* fix(web): keep sidebar terminal pulses in sync by @t3dotgg in pingdotgg/t3code#12962
* feat(web): add iPhone Duo 3D controls by @juliusmarminge in pingdotgg/t3code#12813
* fix(relay): export tunnel cleanup counters to Axiom by @juliusmarminge in pingdotgg/t3code#13528
* fix(server): Grok accounts with no usage yet no longer vanish from Limits by @jakeleventhal in pingdotgg/t3code#12799
* fix(server): report the Grok account email so usage limits merge across environments by @jakeleventhal in pingdotgg/t3code#12588
* feat(web): add usage page keybinding by @jakeleventhal in pingdotgg/t3code#9434
* chore: clear Effect language service suggestions by @juliusmarminge in pingdotgg/t3code#13536
* ci(relay): add a forced manual relay deploy by @juliusmarminge in pingdotgg/t3code#13550
* fix(web): selected text stays visible on a revealed file line by @t3dotgg in pingdotgg/t3code#13548
* fix(web): collapsed composer bar stops flipping its labels while you scroll by @t3dotgg in pingdotgg/t3code#13555
* fix(clients): sync status no longer flickers when opening running threads by @t3dotgg in pingdotgg/t3code#13551
* fix(server): newer Codex models get T3 Code's instructions again by @t3dotgg in pingdotgg/t3code#13547


**Full Changelog**: pingdotgg/t3code@v0.0.43-nightly.20260924.2223...v0.0.43-nightly.20260925.2237

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.43-nightly.20260925.2237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant