Skip to content

feat(analytics): add Sentry, MetaMetrics, Segment, and Tempo skills - #76

Open
MajorLift wants to merge 10 commits into
MetaMask:mainfrom
MajorLift:add/analytics-tracing-cross-ref
Open

feat(analytics): add Sentry, MetaMetrics, Segment, and Tempo skills#76
MajorLift wants to merge 10 commits into
MetaMask:mainfrom
MajorLift:add/analytics-tracing-cross-ref

Conversation

@MajorLift

@MajorLift MajorLift commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Adds an analytics domain for Sentry / MetaMetrics / Segment / Grafana Tempo observability.

Supersedes #41, which is closed; this PR carries the whole domain.

Skills

  • sentry-quota — catch quota-risky span instrumentation in code and PRs: the fan-out × ungated × no-kill-switch product. Covers the incidental cases that are easy to miss — spans created inside memoized selectors (which fan out per row, forever), and the latent optional trace parameter that detonates the moment a caller wires it up.
  • sentry-mcp-queries — query Sentry via MCP: error triage, volume estimation, release comparison, replay. Includes the 30D+ percentile-fidelity rules (filter superseded and low-sample releases; anchor on the highest-sample patch, never the .0).
  • grafana-tempo-queries — query backend traces with TraceQL: search by service or span attribute, fetch by id, inspect the span tree, enumerate tag values. Documents the failure modes that produce confidently wrong conclusions: an expired session returns 401 with an empty body that parses as zero results — indistinguishable from "this data doesn't exist" — and a filter that silently fails to apply returns a full page of apparent matches. Hence a mandatory negative control before believing any negative result.
  • sentry-grafana-correlation — join one trace across Sentry and Tempo by trace id, and diagnose why a half is missing. Built on the three rules that explain every missing half: the propagated sampled flag and the client's own retention are separate decisions (which is what manufactures orphaned backend spans), a not-sampled flag suppresses backend span creation rather than dropping it later, and an environment attribute decides whether backend spans reach Sentry at all.
  • instrumentation — create/update Sentry spans, MetaMetrics events, and Segment events.
  • performance-attribution — attribute release-over-release p75/p95 movement to specific code changes via black-box diff analysis, deliberately ignoring commit messages and claimed impact.

Knowledge

metrametrics-identity (isOptIn:true sends events as anonymous) · span-sub-sampling (deterministic per-trace sub-sampling for high-frequency spans) · segment-governance (the event-governance gap with no CI enforcement).

Notes

  • This repository is public, so all hosts, datasource uids, org slugs, and project ids are environment-variable indirected rather than hardcoded; each skill documents how to discover its own.
  • No CHANGELOG entry. Per CONTRIBUTING, that file tracks consumer-facing changes to the @metamask/skills CLI package; skill-only PRs don't add one.
  • New domain, no CODEOWNERS entry yet/domains/analytics/ falls to the * catch-all. Tell me which team should own it and I'll add the line.
  • grafana-tempo-queries is the backend counterpart to sentry-mcp-queries; sentry-grafana-correlation depends on both.

Validation runs

Trial runs of this PR's skills against merged metamask-extension PRs nobody flagged. Every claim was re-verified against the real diff before posting. Clean results are included on purpose — a skill that only ever reports problems cannot be calibrated.

PR Skill Verdict Finding
#41528 sentry-quota Gap ~24 spans/hr from a background poller, no per-name gate
#44978 sentry-quota Clean gate sits in the injected callback, so consumers inherit it

Each comment carries a trial-run disclaimer and links back here for feedback.

MajorLift added 7 commits June 5, 2026 14:52
sentry-mcp-queries: document data-fidelity loss on older releases for
longer-range (30D+) queries (sample-rate drift, extrapolation hiding thin
samples, retention downsampling) and percentile (p75+) sample-size/quality
filtering; add table rows + pitfalls for stored-span-count and
superseded-patch releases.

performance-attribution: new skill for attributing release-over-release
p75/p95 movements to code changes via black-box diff analysis, with an
extension repo file (Trace Explorer queries, key transactions,
highest-sample-patch version selection, 90d-vs-30d empirics, hot-path
files, core-package changelog analysis, worked v13.11->v13.15 catalogue).

analytics-instrumentation: cross-link volume-estimation caveats to the
new fidelity guidance. CHANGELOG updated.
…n-out, latent trace? param, trace-arg PR-review scan, per-name budget
CHANGELOG.md tracks consumer-facing changes to the `@metamask/skills` package,
per CONTRIBUTING's "CLI / tooling changes" section. No merged skill-only PR adds
an entry (MetaMask#80, MetaMask#78, MetaMask#70, MetaMask#62, MetaMask#61 all touch zero changelog lines).

Carrying one here bought nothing and was the sole source of this branch's
conflict with `main`, since every skill PR edits the same `[Unreleased]` block.
Restoring the file to its merge-base state makes the branch conflict-free
without a merge commit.
@MajorLift MajorLift changed the title feat(analytics): add grafana-tempo-queries and sentry-grafana-cross-ref skills feat(analytics): add analytics domain — Sentry, MetaMetrics, Segment, Grafana Tempo Jul 30, 2026
@MajorLift MajorLift changed the title feat(analytics): add analytics domain — Sentry, MetaMetrics, Segment, Grafana Tempo feat(analytics): add Sentry, MetaMetrics, Segment, and Tempo skills Jul 30, 2026
@MajorLift
MajorLift marked this pull request as draft July 30, 2026 14:03
@MajorLift
MajorLift marked this pull request as ready for review July 30, 2026 18:15
@MajorLift

MajorLift commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Context budget

What this PR costs an agent, measured from an install rather than read from the diff. Three tiers, and only the first is unavoidable.

Skill Frontmatter Selected + refs & knowledge
grafana-tempo-queries 711 chars ~1,860 tok ~1,860 tok
instrumentation 111 chars ~1,610 tok ~1,610 tok
performance-attribution 113 chars ~2,649 tok ~2,649 tok
sentry-grafana-correlation 870 chars ~2,001 tok ~2,001 tok
sentry-mcp-queries 90 chars ~2,673 tok ~2,673 tok
sentry-quota 132 chars ~2,764 tok ~2,764 tok

Frontmatter is the only tier paid unconditionally — every agent loads it on every run once the skill is installed, used or not, because it is what the agent reads to decide relevance. The 28 skills across the eleven open skill PRs sit at a median of ~1,716 tokens selected and ~1,860 with references followed. All are within the 1,536-character description budget.

Selected is paid only when the agent picks the skill. + refs & knowledge is the ceiling if every bundled reference is then read; it is a worst case, not an expectation.

Method

tools/install --repo metamask-extension --maturity experimental against this branch at 0da684bdc, measured per installed skill directory. Repo overlays are merged into the emitted SKILL.md, so they land in the selected tier rather than being missed by a source-byte count. Token figures are bytes/4 — a proxy for scale, not accounting.

These figures are pinned to the commit above and drift on every push; #96 tracks automating them.

The skill lives in the `analytics` domain, so the prefix repeated what the path
and every discovery surface already show. Installed as `mms-instrumentation`.
"Cross-ref" describes the mechanism and reads as a generic pointer. The skill
produces a correlation: one trace joined across two stores by `trace_id`, plus a
reading of which absences are expected.

The vendor names stay. They are load-bearing here rather than incidental — the
skill is about the split between Sentry and Grafana Tempo specifically, and is
not source-agnostic.
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