Skip to content

feat: keep Sentry transactions out of the feed, read all traces from one store - #378

Closed
roxblnfk wants to merge 6 commits into
masterfrom
feat/telemetry-one-store
Closed

roxblnfk wants to merge 6 commits into
masterfrom
feat/telemetry-one-store

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

What was changed

  • Sentry transactions (envelope transaction items, /store transactions, span-only v2 envelopes) no longer make sentry feed events: they go only to the telemetry store, as in buggregator/server. The feed holds the errors; an envelope with an error and its transaction still yields the error event. A transaction without a trace ID fits no trace and stays a feed event; a /store payload with an exception is an error whatever its type. The console prints one line per trace instead of "There is no renderer", e.g. Trace 541c…: POST /checkout (http.server), 640 ms, 5 spans, 2 failed (the transaction counts as a span, as in list_traces); spans sent without a transaction are named after their root span.
  • MCP list_traces and get_trace read the telemetry store of the web UI, so they cover Sentry and OpenTelemetry traces alike. list_traces gains project and source filters and services, sources, projects in each row; service now matches any service of the trace (* also a trace without services), and spans counts spans and transactions. get_trace shows a Sentry span as op: description with a kind read from its op, and its header names services, sources and projects. list_events and wait_for_events tell agents that transactions are traces.
  • The Tracing SpanStore is gone. The console keeps only its own SpanBuffer (still bound by TRAP_TRACES_*): it renders frames in batches after they are stored, and it needs the OTLP spans with their kinds, events and links. The MCP tools follow TRAP_TELEMETRY_MAX_SPANS; a trace no longer expires 600 s after its last span, and clearing the Sentry pages drops it for the tools too. get_event no longer lists the spans of a transaction; a transaction item of an error envelope points at get_trace.
  • Unrelated fix: Measure::memory(0) no longer warns "float -INF is not representable as an int" (seen during trap test).

Why?

A transaction was stored twice and showed in the UI 1.39 feed as an "Unknown / Something went wrong" card, and OTLP traces were stored twice as well (span store for MCP, telemetry store for the UI).

Checklist

  • Tested
    • Tested manually: trap --ui --mcp with trap test — no transaction cards in the feed, Traces list, trace page and sequence answer, the console prints the OTLP trees and the Sentry trace lines, MCP list_traces/get_trace over HTTP JSON-RPC return both the Sentry checkout trace and the OTel gateway→orders trace
    • Unit tests added; Unit, Arch and Acceptance suites pass (except the 3 ProtobufCaster tests that fail on this machine before the change too), structarmed, psalm under PHP 8.5 (only the pre-existing Run::getSubscribedSignals findings of Windows), markdownlint as CI runs it

Documentation

docs/mcp.md, docs/sentry.md, docs/opentelemetry.md, docs/web-ui.md, docs/configuration.md and the trap skill (SKILL.md, references/mcp.md, integrations.md, server.md).

A transaction made a `sentry` feed card the web UI 1.39 can't show and was stored a second time as a trace; buggregator/server keeps it out of the feed too. Envelope `transaction` items, `/store` transactions and span-only envelopes now go to the telemetry store alone, while an error sent with its transaction still makes the error event. The console prints one trace line for a transaction or v2 spans, and `get_event` points a transaction item of an error envelope at `get_trace`.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
… web UI

refactor(tracing): drop the span store of the MCP tools, keep the buffer of the console

`list_traces` and `get_trace` read the telemetry store the Sentry pages show, so they cover Sentry transactions and OTLP spans alike, with `services`, `sources` and `projects` in the list and new `project` and `source` filters as the UI API has. The store fills whenever the UI or the MCP server runs and is bound by `TRAP_TELEMETRY_MAX_SPANS`; a trace no longer expires 600 seconds after its last span. The console keeps its own span buffer, still limited by `TRAP_TRACES_*`: it renders frames in batches after they are stored and needs the OTLP spans with their kinds, events and links.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added enhancement New feature or request tests Changes in the tests labels Nov 22, 2026
@codecov

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.31138% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.48%. Comparing base (6fcd72c) to head (4f14272).

Files with missing lines Patch % Lines
src/Module/Tracing/Mcp/TraceSpans.php 80.24% 16 Missing ⚠️
src/Module/Sentry/Console/TraceLine.php 98.43% 1 Missing ⚠️
src/Module/Tracing/Mcp/GetTrace.php 95.45% 1 Missing ⚠️
src/Module/Tracing/Mcp/TraceSummary.php 98.63% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #378      +/-   ##
==========================================
+ Coverage   80.26%   80.48%   +0.22%     
==========================================
  Files         424      426       +2     
  Lines       16858    17056     +198     
==========================================
+ Hits        13531    13728     +197     
- Misses       3327     3328       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

`log(0)` is `-INF`, and casting it to int warned "float -INF is not representable as an int" whenever a profile reported zero memory, as `trap test` does.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
…or of any type in the feed

A transaction without a trace ID fits no trace, so it stays a `sentry` event instead of being lost; a `/store` payload with an exception is an error even when typed `transaction`, as in buggregator/server. The console trace line counts the transaction among the spans, as `list_traces` does, and names spans sent without a transaction after their root span.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
…event tools to `list_traces`

docs(skill): name Sentry traces and their shared limit in the MCP and server references

An empty root service falls back to another part's service, and `list_events` and `wait_for_events` tell agents that Sentry transactions are traces.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
…read transaction spans as the store does

docs: state that `service: "*"` takes a trace without services and that the trace limit counts transactions

The console showed such a transaction, now a feed event, as an item it could not render. `get_event` read the spans of a transaction on its own and could name a trace ID or a span count the telemetry store did not keep; it now reads them with the store's reader.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk

Copy link
Copy Markdown
Member Author

Landed on master as a fast-forward of three signed commits: 60f5e8c, 77af46e, 547e19b (same tree as 4f14272).

@roxblnfk roxblnfk closed this Nov 22, 2026
@roxblnfk
roxblnfk deleted the feat/telemetry-one-store branch November 23, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tests Changes in the tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant