[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H37PWM4DE4BMSC6CSTVZVS":3,"skill-same:01M6H37PWM4DE4BMSC6CSTVZVS":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":29,"linkOnly":30,"markdownContent":31,"markdownBody":32,"frontMatter":33,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":41,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M6H37PWM4DE4BMSC6CSTVZVS","instrumentation",null,"Create and update Sentry spans, MetaMetrics events, and Segment events — methodology, policies, common pitfalls","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-instrumentation\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-instrumentation\u002FSKILL.md",[],[5,20,21,22,23,24,25,26,27,28],"create","update","sentry","methodology","common","events","segment","common pitfalls","pitfalls","2026-11-10 10:12:30",false,"---\nmaturity: experimental\nname: instrumentation\ndescription: Create and update Sentry spans, MetaMetrics events, and Segment events — methodology, policies, common pitfalls\n---\n\n# Analytics Instrumentation\n\n## When To Use\n\n- Adding or modifying a MetaMetrics (Segment) event\n- Adding or modifying a Sentry performance span\n- Estimating event or span volume from production data\n- Auditing existing instrumentation for correctness\n\n---\n\n## Do Not Use When\n\n- Adding local debug logging with no telemetry destination\n- Investigating an existing Sentry error report (use `sentry-mcp-queries`)\n- Internal feature flag evaluation not surfaced as an analytics event\n\n---\n\n## Sentry Spans\n\n### Creating a Span\n\n1. **Register a named trace entry** in the repo's trace name enum before writing any span code. Unnamed spans are invisible in Sentry filters.\n2. **Use the repo's `trace()` wrapper**, not raw `Sentry.startSpan()`. Wrappers handle cross-process context propagation, active-span inheritance, and consistent tag injection.\n3. **Inherit parent automatically** — when no `parentContext` is provided, the wrapper inherits from `Sentry.getActiveSpan()`, making the new span a child of the active parent (e.g., a `pageload` span). That parent is whichever span is active at the call, not necessarily the one that caused the work, which metamask-extension#45527 (stop spans silently attaching to whatever trace happens to be active) proposes to fix. A span started by `trace()` without a callback is active only inside that call, so spans created before its `endTrace()` do not nest under it.\n\n### Updating a Span\n\n- Adding a tag: no governance required\n- Renaming a trace name enum entry: grep all callsites; update enum and references atomically\n- Changing an `op` value: breaks saved queries and dashboards — coordinate with whoever owns them\n- Moving a span's start (`trace()`) or end (`endTrace()`): changes what its duration measures, so a release-over-release delta mixes a performance change with a definition change\n\n---\n\n## MetaMetrics \u002F Segment Events\n\n### Creating an Event\n\n1. **Check the event name enum** — event may already exist under a different phrasing.\n2. **Check the segment tracking plan** — event may be registered under a different name than the enum key.\n3. **Add to the enum**, then implement the `trackEvent` call.\n4. **Pass `excludeMetaMetricsId: true` only for an event that must not carry the user's identity.** It sends the event under the shared anonymous id and drops the profile ids, for every user, not only those who have not opted in. Event names matching `\u002F^send|^confirm\u002Fiu` get it by default unless the caller passes `excludeMetaMetricsId: false` (see data domain `knowledge\u002Fmetrametrics-identity.md`).\n5. **Open a data governance review** before merging. There is usually no CI enforcement on schema registration — this step is easy to skip (see data domain `knowledge\u002Fsegment-governance.md`).\n6. **Register in the team's segment tracking plan** before shipping.\n\n### Updating an Event\n\n- Adding a property: requires governance review and schema update\n- Renaming an event: deprecate old + add new in tracking plan; coordinate on migration window\n- Removing an event: confirm no active dashboards depend on it before removing\n\n---\n\n## Volume Estimation via Sentry\n\nWhen direct Segment access is unavailable, estimate from Sentry production span data:\n\n1. **Find a correlated HTTP endpoint** — one that fires 1:1 with the event.\n2. **Query Sentry Traces Explorer** (aggregate mode):\n   ```\n   span.op:http.client span.description:*{endpoint}*\n   ```\n3. **Read the `count()` aggregate.** Span datasets already extrapolate it by each span's sample weight, so it is the estimate. Do not multiply it by `1 \u002F tracesSampleRate`, which extrapolates twice.\n4. **Interpret as upper bound** — endpoint may have callers outside the event path.\n\nCaveats: sample population is MetaMetrics opted-in users only. The extension's Sentry integration drops every event unless `consentDecisionMade && optedIn`, and Segment gates differently, so attribution across the two pipelines holds at install granularity, not per session. For longer-range (30D+) or release-over-release queries, the sampled count is **not** comparable at face value — older releases are downsampled \u002F retention-truncated and `.0` releases are sample-thin; see `sentry-mcp-queries` (Longer-Range Queries and Percentile Fidelity) and the `performance-attribution` skill.\n\n---\n\n## Common Pitfalls\n\n| Mistake | Correct Approach |\n|---------|-----------------|\n| `excludeMetaMetricsId: true` on an event that needs user identity | It sends the event under the shared anonymous id for every user. Reserve it for events that must be anonymous |\n| Ship event without tracking-plan registration | No CI gate — add governance review explicitly to PR checklist |\n| Raw `Sentry.startSpan()` instead of the repo's `trace()` wrapper | Use the wrapper — handles cross-process context and active-span inheritance |\n| New span with no trace name enum entry | Register enum entry first; unnamed spans are invisible in Sentry filters |\n| Multiply a span `count()` by `1 \u002F tracesSampleRate` | `count()` is already extrapolated, so read it as the estimate |\n| Treat Sentry estimates as exact counts | Probabilistic sample — state sample size and confidence |\n","# Analytics Instrumentation\n\n## When To Use\n\n- Adding or modifying a MetaMetrics (Segment) event\n- Adding or modifying a Sentry performance span\n- Estimating event or span volume from production data\n- Auditing existing instrumentation for correctness\n\n---\n\n## Do Not Use When\n\n- Adding local debug logging with no telemetry destination\n- Investigating an existing Sentry error report (use `sentry-mcp-queries`)\n- Internal feature flag evaluation not surfaced as an analytics event\n\n---\n\n## Sentry Spans\n\n### Creating a Span\n\n1. **Register a named trace entry** in the repo's trace name enum before writing any span code. Unnamed spans are invisible in Sentry filters.\n2. **Use the repo's `trace()` wrapper**, not raw `Sentry.startSpan()`. Wrappers handle cross-process context propagation, active-span inheritance, and consistent tag injection.\n3. **Inherit parent automatically** — when no `parentContext` is provided, the wrapper inherits from `Sentry.getActiveSpan()`, making the new span a child of the active parent (e.g., a `pageload` span). That parent is whichever span is active at the call, not necessarily the one that caused the work, which metamask-extension#45527 (stop spans silently attaching to whatever trace happens to be active) proposes to fix. A span started by `trace()` without a callback is active only inside that call, so spans created before its `endTrace()` do not nest under it.\n\n### Updating a Span\n\n- Adding a tag: no governance required\n- Renaming a trace name enum entry: grep all callsites; update enum and references atomically\n- Changing an `op` value: breaks saved queries and dashboards — coordinate with whoever owns them\n- Moving a span's start (`trace()`) or end (`endTrace()`): changes what its duration measures, so a release-over-release delta mixes a performance change with a definition change\n\n---\n\n## MetaMetrics \u002F Segment Events\n\n### Creating an Event\n\n1. **Check the event name enum** — event may already exist under a different phrasing.\n2. **Check the segment tracking plan** — event may be registered under a different name than the enum key.\n3. **Add to the enum**, then implement the `trackEvent` call.\n4. **Pass `excludeMetaMetricsId: true` only for an event that must not carry the user's identity.** It sends the event under the shared anonymous id and drops the profile ids, for every user, not only those who have not opted in. Event names matching `\u002F^send|^confirm\u002Fiu` get it by default unless the caller passes `excludeMetaMetricsId: false` (see data domain `knowledge\u002Fmetrametrics-identity.md`).\n5. **Open a data governance review** before merging. There is usually no CI enforcement on schema registration — this step is easy to skip (see data domain `knowledge\u002Fsegment-governance.md`).\n6. **Register in the team's segment tracking plan** before shipping.\n\n### Updating an Event\n\n- Adding a property: requires governance review and schema update\n- Renaming an event: deprecate old + add new in tracking plan; coordinate on migration window\n- Removing an event: confirm no active dashboards depend on it before removing\n\n---\n\n## Volume Estimation via Sentry\n\nWhen direct Segment access is unavailable, estimate from Sentry production span data:\n\n1. **Find a correlated HTTP endpoint** — one that fires 1:1 with the event.\n2. **Query Sentry Traces Explorer** (aggregate mode):\n   ```\n   span.op:http.client span.description:*{endpoint}*\n   ```\n3. **Read the `count()` aggregate.** Span datasets already extrapolate it by each span's sample weight, so it is the estimate. Do not multiply it by `1 \u002F tracesSampleRate`, which extrapolates twice.\n4. **Interpret as upper bound** — endpoint may have callers outside the event path.\n\nCaveats: sample population is MetaMetrics opted-in users only. The extension's Sentry integration drops every event unless `consentDecisionMade && optedIn`, and Segment gates differently, so attribution across the two pipelines holds at install granularity, not per session. For longer-range (30D+) or release-over-release queries, the sampled count is **not** comparable at face value — older releases are downsampled \u002F retention-truncated and `.0` releases are sample-thin; see `sentry-mcp-queries` (Longer-Range Queries and Percentile Fidelity) and the `performance-attribution` skill.\n\n---\n\n## Common Pitfalls\n\n| Mistake | Correct Approach |\n|---------|-----------------|\n| `excludeMetaMetricsId: true` on an event that needs user identity | It sends the event under the shared anonymous id for every user. Reserve it for events that must be anonymous |\n| Ship event without tracking-plan registration | No CI gate — add governance review explicitly to PR checklist |\n| Raw `Sentry.startSpan()` instead of the repo's `trace()` wrapper | Use the wrapper — handles cross-process context and active-span inheritance |\n| New span with no trace name enum entry | Register enum entry first; unnamed spans are invisible in Sentry filters |\n| Multiply a span `count()` by `1 \u002F tracesSampleRate` | `count()` is already extrapolated, so read it as the estimate |\n| Treat Sentry estimates as exact counts | Probabilistic sample — state sample size and confidence |\n",{"name":5,"maturity":34,"description":7},"experimental","main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fwallets\u002Fmetamask-official-instrumentation",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-13 02:31:19",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill instrumentation",{"tool":50,"command":51},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill instrumentation",{"tool":53,"command":54},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill instrumentation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-instrumentation\u002FSKILL.md",true,[58,62,68,72],{"path":59,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":16},"LICENSE","许可证",1065,{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"repos\u002Fmetamask-extension.md","REFERENCE","参考文档",3325,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-instrumentation\u002Frepos\u002Fmetamask-extension.md",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"SOURCE.md",372,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-instrumentation\u002FSOURCE.md",{"path":73,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":74,"sourceHtmlUrl":75},"TRUST.auto.yaml",2197,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-instrumentation\u002FTRUST.auto.yaml",[77,104,127,145,158,168],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":81,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":29},"01M712C436EQYE43342Q4E7GG1","recipe-performance","Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold\u002Fwarm\u002Fbackground-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout\u002Fpaint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FSKILL.md",[],[85,86,87,88,22,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103],"performance","recipe performance","recipe","mm","harness","app","deterministic","recipes","flow","cold","critical","analysis","tasks","react","browser","layout","screen","network","metamask",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":109,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":29},"01M70XT2F8A5CQZ81JBP98KSW3","mexc-spot-websocket","MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FSKILL.md",[],[113,114,115,116,117,118,119,120,121,122,123,124,125,126],"mexc spot websocket","spot","websocket","api","workflows","public","listen","streams","depth","keys","for","api keys","maintenance","protobuf",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":131,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":29},"01M70XT0MBXN3WZY1BKN0CPNKR","mexc-spot-rest","MEXC Spot REST workflows for public data, signed account requests, orders, wallet\u002Fadmin actions, and secure signing without exposing API keys.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FSKILL.md",[],[135,114,136,137,138,139,140,124,123,122,141,142,143,118,144,117,116],"mexc spot rest","REST","admin","signing","Wallet","requests","actions","secure","data","orders",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":149,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":29},"01M70XSYSVZ2N0N91XCAR2CAK0","mexc-futures-websocket","MEXC Futures WebSocket workflows for public streams, private account\u002Forder\u002Fposition streams, ping\u002Fpong, subscriptions, and depth maintenance.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FSKILL.md",[],[153,154,115,155,156,125,123,157,121,120,118,117],"mexc futures websocket","futures","position","ping","subscriptions",{"skillNo":159,"name":160,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":161,"sourceHtmlUrl":162,"categories":163,"keywords":164,"publishedAt":29},"01M6H0ZWHVE5W04WG2DKQE2SQC","0xklen-version-and-refresh-sanctions-lists","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FSKILL.md",[],[165,166,167],"refresh","0xklen version and refresh sanctions lists","version",{"skillNo":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":172,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":29},"01M6H0Z28Q3R8J0S799GJQWXM3","verify-tests-cover-changed-lines","Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FSKILL.md",[],[176,177,178,179,180,181,182,183,184,185,186],"tests","cover","verify tests cover changed lines","verify","coverage","pr","exercise","use","patch","code","share"]