Repository navigation
Trace exporter follow-ups from the PR #244 review #274
Copy link
Copy link
Open
0 / 40 of 4 issues completedLabels
priority:P2Maintainers onlyMaintainers onlyscope:in-focusFeeds the ninety-day committed outcome. Maintainers onlyFeeds the ninety-day committed outcome. Maintainers onlystatus:acceptedIn the backlog. Maintainers onlyIn the backlog. Maintainers onlytype:refimplReference implementation or adapter workReference implementation or adapter workworkstream:refimplOwning workstream. Maintainers onlyOwning workstream. Maintainers only
Milestone
Description
The review of PR #244 turned up these, and none of them blocked the merge, so they're collected here so they don't get lost. Each one was confirmed by running it during the review.
Exporter (packages/guardian/src/otel-trace-exporter.ts):
- A failed output stays off for the life of the process.
isolated()never resetsdead, so a collector that restarts for longer than 2 s ends endpoint export for good, with one stderr line. Retry with a backoff and count the dropped spans. - The span starts before validation, so a request that fails validation can set the session and request ids on a span. Re-posting a real pair without a JSON-RPC id put a
guardian_errorevent on that pair, which marks the real decision as not enforced. Either mark spans from invalid envelopes or keep their ids under separate keys. ACS_OTEL_FILEfollows a symlink, and an existing file keeps its mode (0644 stays 0644). Open withO_NOFOLLOWand tighten the mode, or refuse.ACS_OTEL_ENDPOINTaccepts plainhttp://to a remote host, and the sample collector's receiver has no auth. Warn on a non-loopbackhttpendpoint and document TLS and headers.
Host adapter (packages/host-adapter/):
- Audit entries carry no tool name, so converter spans lack
gen_ai.tool.name, which the mapping requires on step spans. The sample trace for issue [RefImpl] Commit a sample OTLP trace from the reference Guardian, and test the exporter against it #266 has to account for that until it's fixed. - An unparseable Guardian response is filed under kind
unknown, so it converts tootherinstead ofmalformed_response. - A malformed
askwas denied with no audit entry, although issue [Bug]: acs.decision trace event cannot carry reason_codes, policy_references, cited_provenance_ids, or chain_hash, so replay from the trace alone is not possible #228 says the Observed Agent records every decision failure. - The Claude Code shim sends no
request_id_refonsteps/toolCallResultand nocapability, so host-driven traces lack both.
Repo:
- Dependabot has no
bunecosystem, so nothing proposes updates for the new@opentelemetrypins. That needs a.github/change, which a project lead approves.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority:P2Maintainers onlyMaintainers onlyscope:in-focusFeeds the ninety-day committed outcome. Maintainers onlyFeeds the ninety-day committed outcome. Maintainers onlystatus:acceptedIn the backlog. Maintainers onlyIn the backlog. Maintainers onlytype:refimplReference implementation or adapter workReference implementation or adapter workworkstream:refimplOwning workstream. Maintainers onlyOwning workstream. Maintainers only
Type
Projects
- StatusShow more project fieldsIn progress
Activity
rocklambros commentedon Oct 14, 2026
Two more from the PR #275 review, both for the exporter in PR #244 once PR #275 merges:
otel-trace-exporter.tsstill saysacs.decision.failure"is not in otel-mapping.json yet" and that the mapping has no attribute for the request id. PR Carry the decision's replay facts and decision failures on Trace #275 adds both, so read the failure event name andstep_span_attributesfrom the mapping and drop those comments.DECISION_DETAIL_NAMESexists so the exporter works before and after PR Carry the decision's replay facts and decision failures on Trace #275. Once it merges, the mapping covers those names, and the list can go.The
agtjob (bun) is also not a required check on integration, so a red run there does not stop a merge.bar-capsule commentedon Oct 15, 2026
@rocklambros a few more from my pass on #244 that aren't in the list yet (checked by running it):
bar-capsule commentedon Oct 15, 2026
More from a deeper pass on #244, checked against 8058752, most by running it. The four that matter before the lab handoff are in #276.
sabasiddique1 commentedon Oct 15, 2026
Thanks for collecting these. I wrote the exporter and the converter, so I’d like to take this issue end to end, in three PRs.
Failed outputs. The permanent dead flag, the hung file write and the silent drops past the span queue are one problem: an output fails or stalls, and nothing recovers or counts it. I’ll replace dead with a per-output breaker. It retries with backoff, caps pending writes, and keeps a dropped-span count that’s reported on recovery and at shutdown.
Hardening. Ids from invalid envelopes go under separate keys rather than marking the span, so the default join can’t pick them up. ACS_OTEL_FILE opens with O_NOFOLLOW and refuses a file wider than 0600. The http warning, the signal path and the shutdown class go here too.
Converter, tests and README, from Bar’s list.
Some of it has to wait. Reading names and classes from the mapping needs #275; the hook spans need #229. I’m leaving the host-adapter items until #229 lands, Dependabot to a lead, and the required-attribute check to #266.
Two questions. close() dropping in-flight connections overlaps with #112: should I wait for it, or fix it on the exporter side now? And is a stderr line enough for the dropped-span count, or do you want it in the trace?
bar-capsule commentedon Oct 15, 2026
From the review of #277 (checked by running it):
Commit a sample trace and a walkthrough anyone can run, and fix the c…
Keep a user's proxy exemptions, warn when loopback would reach a prox…
rocklambros commentedon Oct 15, 2026
@sabasiddique1, thank you for taking this on. You wrote the exporter and the converter, so you're the right person for it. I've assigned issue #274 to you and to me.
Some things changed since your comment, so here is the current state.
What is already done or unblocked
service.nameOTEL_BSP_*NO_PROXYfixtest/sample-trace.test.ts.agtcheck required.Your three PRs, as three sub-issues
I split issue #274 into sub-issues, so each of your PRs can close its own part and issue #274 stays open until all of them are done.
Issue #285 holds the host-adapter items. They wait for PR #229, and they are not yours yet.
Each sub-issue lists its scope and the tests that prove it. Please read them before you start. Some details changed after a review, especially these two:
exportruns, so a retry needs its own buffer. If you keep one, limit it by count and by bytes, drop the oldest first, count what you drop, and never drain it during shutdown. One large request can make a span of about 0.5 MB, so issue [RefImpl] Recover a failed or stalled trace output and count the spans it drops #282 also asks for a byte limit per span.Your questions
Question 1: should you wait for PR #112 before fixing
close()?No, don't wait. The fix is one change in
server.ts, around line 491. Changeserver.stop(true)toserver.stop(), inside the existingPromise.race. We tested it, and the in-flight response is delivered. Please send it as a small separate PR with a regression test, and don't change the exporter for this. I'll add a note on PR #112 that its rebase must keep thePromise.race.Question 2: is a stderr line enough for the dropped-span count?
Yes, for now. Report the count per output:
The trace is not the right place yet, for two reasons. The mapping has no attribute for this, so adding one is a Spec change. And when an output is down, a span about it can't reach that output either. If we want the gap inside the trace later, that is a proposal for the Spec leads.
How to write each PR
Closes #282(or the sub-issue for that PR) andRefs #274.Closes #274, because that would close the whole umbrella issue.One request
Please leave a short comment on issue #282. GitHub only lets me assign you to an issue after you have commented on it.
If anything here is unclear, ask on the sub-issue. I'll answer there.
sabasiddique1 commentedon Oct 15, 2026
Thanks @rocklambros, this is clear. Noted on the bounded retry buffer and on tightening to 0600 rather than refusing. I’ll send the close() fix as its own small PR with a regression test, and start #282 alongside it.
Address Ariel's review of the trace exporter (#289)