Skip to content

feat(telemetry): instrument context builder tool runs#327

Open
cameroncooke wants to merge 1 commit into
cameroncooke/sentry-04-mcp-tool-telemetryfrom
cameroncooke/sentry-05-context-builder-telemetry
Open

feat(telemetry): instrument context builder tool runs#327
cameroncooke wants to merge 1 commit into
cameroncooke/sentry-04-mcp-tool-telemetryfrom
cameroncooke/sentry-05-context-builder-telemetry

Conversation

@cameroncooke

@cameroncooke cameroncooke commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Instruments context-builder runs with coarse phase timing and shape metrics.

Stack: 5/10 · depends on PR 2 · Refs GH-183

What this changes

  • ContextBuilderSentryTelemetry.swift (new) — wraps runs in a context_builder.run transaction with context_builder.discovery / export / oracle.response / selection.commit child spans; started/completed/failed breadcrumbs.
  • MCPContextBuilderToolProvider.swift — call sites for the phase spans.

Business rules

  • Records token_budget_bucket (bucketed, never a raw token size), result_count/selection_file_count, and cache_hit.
  • No file paths, names, or contents — the typed model has no case that could carry them.

Key decisions

  • Phase spans (discovery/export/oracle/selection) give workflow timing without exposing what was discovered or selected.

Test plan

  • Builds in both modes. ✅ verified.

@cameroncooke cameroncooke force-pushed the cameroncooke/sentry-05-context-builder-telemetry branch from 4c2cbeb to bd69a32 Compare June 29, 2026 21:40
@cameroncooke cameroncooke force-pushed the cameroncooke/sentry-04-mcp-tool-telemetry branch from 6e88ee9 to 0c1b7d0 Compare June 29, 2026 21:40
@cameroncooke cameroncooke force-pushed the cameroncooke/sentry-04-mcp-tool-telemetry branch from 0c1b7d0 to e33fac7 Compare June 29, 2026 22:48
@cameroncooke cameroncooke force-pushed the cameroncooke/sentry-05-context-builder-telemetry branch from bd69a32 to ec18666 Compare June 29, 2026 22:49
@cameroncooke cameroncooke marked this pull request as ready for review June 30, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant