[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-posthog-exploring-apm-traces":3,"mdc-jgr7qs-key":49,"related-org-posthog-exploring-apm-traces":2881,"related-repo-posthog-exploring-apm-traces":3048},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":44,"sourceUrl":47,"mdContent":48},"exploring-apm-traces","investigate application performance with PostHog APM","Investigates distributed application performance using PostHog APM (OpenTelemetry span) data via MCP. Use when the user asks about service traces, slow HTTP\u002Fdatabase spans, error spans, error-rate trends or spikes, latency distributions, trace IDs, or span attributes — not AI observability traces or product logs. Uses posthog:query-apm-spans, posthog:apm-trace-get, posthog:apm-spans-sparkline, posthog:apm-services-list, posthog:apm-attributes-list, and posthog:apm-attribute-values-list.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"posthog","PostHog","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fposthog.png",[12,16,19,22],{"name":13,"slug":14,"type":15},"Tracing","tracing","tag",{"name":17,"slug":18,"type":15},"Observability","observability",{"name":20,"slug":21,"type":15},"Performance","performance",{"name":9,"slug":8,"type":15},35568,"https:\u002F\u002Fgithub.com\u002FPostHog\u002Fposthog","2026-05-06T05:51:58.80942",null,2977,[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"ab-testing","ai-analytics","analytics","cdp","data-warehouse","experiments","feature-flags","javascript","product-analytics","python","react","session-replay","surveys","typescript","web-analytics",{"repoUrl":24,"stars":23,"forks":27,"topics":45,"description":46},[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"🦔 PostHog is an all-in-one developer platform for building successful products. We offer product analytics, web analytics, session replay, error tracking, feature flags, experimentation, surveys, data warehouse, a CDP, and an AI product assistant to help debug your code, ship features faster, and keep all your usage and customer data in one stack.","https:\u002F\u002Fgithub.com\u002FPostHog\u002Fposthog\u002Ftree\u002FHEAD\u002Fproducts\u002Ftracing\u002Fskills\u002Fexploring-apm-traces","---\nname: exploring-apm-traces\ndescription: >\n  Investigates distributed application performance using PostHog APM (OpenTelemetry span) data via MCP.\n  Use when the user asks about service traces, slow HTTP\u002Fdatabase spans, error spans, error-rate trends or\n  spikes, latency distributions, trace IDs, or span attributes — not AI observability traces or product logs.\n  Uses posthog:query-apm-spans, posthog:apm-trace-get, posthog:apm-spans-sparkline,\n  posthog:apm-services-list, posthog:apm-attributes-list, and posthog:apm-attribute-values-list.\n---\n\n# Exploring APM traces (OpenTelemetry spans)\n\nPostHog captures distributed traces from OpenTelemetry. Each trace is a tree of spans representing a request's path through services.\n\n**Disambiguation:** This skill is for **APM \u002F OpenTelemetry traces**. Do not confuse with **AI observability traces** (agent\u002Fmodel `$ai_*` events) or **logs** (`posthog:query-logs`, `posthog:logs-*`).\n\n## Available tools\n\n| Tool                                   | Purpose                                           |\n| -------------------------------------- | ------------------------------------------------- |\n| `posthog:query-apm-spans`              | Search and filter spans (compact list view)       |\n| `posthog:apm-trace-get`                | Get the full span list for one hex `trace_id`     |\n| `posthog:apm-spans-aggregate`          | Per-operation aggregates (count, p50\u002Fp95, errors) |\n| `posthog:apm-spans-tree`               | Call-tree aggregates per `(parent, child)` edge   |\n| `posthog:apm-spans-count`              | Scalar span count — cheap filter pre-flight       |\n| `posthog:apm-spans-sparkline`          | Span counts over time (zero-filled time series)   |\n| `posthog:apm-spans-duration-histogram` | Trace counts per log-scale duration bucket        |\n| `posthog:apm-attribute-breakdown`      | Span counts grouped by one attribute's value      |\n| `posthog:apm-services-list`            | List distinct service names                       |\n| `posthog:apm-attributes-list`          | List span or resource attribute keys              |\n| `posthog:apm-attribute-values-list`    | List values for a specific attribute key          |\n\nSee [references\u002Fspans-and-fields.md](.\u002Freferences\u002Fspans-and-fields.md) for the response schema and the `kind`\u002F`status_code` enums.\n\n## Workflow: debug a trace from a URL\n\n### Step 1 — Fetch the trace\n\n```json\nposthog:apm-trace-get\n{\n  \"trace_id\": \"\u003Chex_trace_id>\"\n}\n```\n\nThe response is `{ results: [span, span, …], _posthogUrl: \"…\" }` — a flat list of every span in the trace.\nThe list can be very large for fan-out request flows; when it exceeds the inline limit, Claude Code auto-persists it to a file.\n\nFrom the result you get:\n\n- Every span with `name`, `service_name`, `kind`, `status_code`, `parent_span_id`, `duration_nano`, `is_root_span`\n- The `_posthogUrl` — a deep link to this trace in the tracing UI; **always include this in your response** so the user can click through\n\n### Step 2 — Parse large results with scripts\n\nWhen the result is persisted to a file (traces with hundreds of spans across services), use the [parsing scripts](.\u002Fscripts\u002F) to explore it.\n\n**Start with the summary** to get the full picture, then drill into specifics:\n\n```bash\n# 1. Overview: services, span count, slowest spans, errors\npython3 scripts\u002Fprint_summary.py \u002Fpath\u002Fto\u002Fpersisted-file.json\n\n# 2. Indented chronological tree (DFS by parent_span_id)\npython3 scripts\u002Fprint_timeline.py \u002Fpath\u002Fto\u002Fpersisted-file.json\n\n# 3. Drill into a specific span by name\nSPAN=\"HTTP GET \u002Fapi\u002Fusers\" python3 scripts\u002Fextract_span.py \u002Fpath\u002Fto\u002Fpersisted-file.json\n\n# 4. Search for a keyword across span names, services, IDs\nSEARCH=\"keyword\" python3 scripts\u002Fsearch_spans.py \u002Fpath\u002Fto\u002Fpersisted-file.json\n\n# 5. When the JSON shape looks unfamiliar\npython3 scripts\u002Fshow_structure.py \u002Fpath\u002Fto\u002Fpersisted-file.json\n```\n\nAll scripts support `MAX_LEN=N` env var to control truncation (`0` = unlimited).\n\n## Tree reconstruction (parent_span_id → span_id)\n\nThe flat span list is a tree. Each span carries:\n\n- `trace_id` — same on every span in the trace\n- `span_id` — this span's unique hex ID\n- `parent_span_id` — points to the parent's `span_id` (zero-padded hex `000…000` for the root)\n- `is_root_span` — convenience flag for the trace entry\n\nTo rebuild the tree:\n\n1. Spans where `is_root_span` is true (or `parent_span_id == \"00000000…\"`) are **root spans**.\n2. Every other span is a child of the span whose `span_id` matches its `parent_span_id`.\n3. Group by `parent_span_id`, walk from each root downward.\n\n`scripts\u002Fprint_timeline.py` does this for you and prints a DFS-indented tree.\n\n## Investigation patterns\n\n### \"Where is time going?\"\n\n1. Every span from `apm-trace-get` carries `self_time_nano` — duration not covered by children. Sort by it: the top span is where wall-clock actually went. A parent with large `self_time_nano` is an **uninstrumented gap** (the work happened inside it, not in any recorded child).\n2. Run `print_summary.py` — it surfaces the top-5 slowest spans by `duration_nano`.\n3. For a noisy trace, run `print_timeline.py` and scan the indented durations — you can see whether time is dominated by one child span or fan-out across many.\n4. To dig into one slow span, `SPAN=\"\u003Cname>\" python3 scripts\u002Fextract_span.py FILE`.\n5. For aggregate \"which child dominates\" questions use `apm-spans-tree` and read `calls_per_parent_invocation` — it separates a child that's slow per call from one that merely runs 20× per parent.\n\n### \"Where did the error happen?\"\n\n1. `print_summary.py` lists every span with `status_code == 2` (Error). Each entry shows service, span name, and parent context.\n2. Walk up the tree from an error span via `parent_span_id` to see what request path led there.\n3. Error detail lives in each span's `attributes` map (e.g. `exception.message`, `exception.type`), which **is** returned in the trace payload — read it directly off the error span. `apm-attribute-values-list` is for discovering values across spans, not a prerequisite for reading one span's attributes.\n\n### \"Did the request hit service X?\"\n\n1. Run `print_summary.py` — it prints the set of services involved in the trace.\n2. If service X is missing, the request never reached it (or instrumentation is missing — check `apm-services-list` to confirm X has emitted spans recently at all).\n\n### \"What's different about the bad spans?\" (over-represented values)\n\n1. Scope to the bad population: `filterGroup` with `status_code = Error`, or a `duration` threshold.\n2. Discover candidate keys with `apm-attributes-list` — typical suspects: `server.address`, `http.response.status_code`, `db.system`, resource keys like `k8s.pod.name` \u002F `service.version`.\n3. Run `apm-attribute-breakdown` per candidate key on the bad set. A value owning most of the `count` is the signature.\n4. Confirm over-representation: re-run without the bad-set filter (or compare `error_count \u002F count` per row). A value at 95% of errors but 10% of traffic is the culprit; one at 95% of both is just volume.\n\n### \"When did it spike?\" (trends over time)\n\n1. `apm-spans-sparkline` with your filters → total counts per time bucket (zero-filled, ~50 adaptive buckets per window).\n2. The same call with `statusCodes: [2]` → error counts per bucket.\n3. Error rate per bucket = errors \u002F total; the bucket where the ratio jumps is when the spike started.\n4. Zoom in: re-run with a narrower `dateRange` around that bucket, then pull raw spans via `query-apm-spans`.\n\n### \"What does the latency distribution look like?\"\n\n1. `apm-spans-duration-histogram` → trace counts per log-scale (1-2-5 series) duration bucket of the ROOT span.\n2. A second hump or a fat tail = a distinct slow population; note its `bucket_ns` range.\n3. Fetch the actual slow traces with `query-apm-spans` using a `duration` filter (nanoseconds) and `orderBy: \"duration\"`.\n\n### \"Did the fan-out look right?\"\n\n1. `print_timeline.py` shows the indentation — wide trees mean parallel calls, deep trees mean sequential dependencies.\n2. Look for spans of kind `Client` (3) followed by matching `Server` (2) spans on the called service — that's a synchronous downstream call.\n\n### Searching by attribute (e.g. `http.method=POST`)\n\nEach span carries an `attributes` map (span-level OTel attributes like `http.method`, `db.statement`) **in the payload** — so for a span you already have, just read it. **Resource** attributes (k8s labels, `service.version`) are not in the payload. To filter the whole dataset by an attribute:\n\n1. Use `apm-attributes-list` \u002F `apm-attribute-values-list` to discover keys and values (resource attributes especially).\n2. Re-issue `query-apm-spans` with a `filterGroup` entry of type `span_attribute` or `span_resource_attribute`.\n\n## Constructing UI links\n\n`apm-trace-get` returns a `_posthogUrl` deep link that opens the trace in the tracing UI — **always surface this to the user** so they can verify in the PostHog UI.\n\n`query-apm-spans` does not return `_posthogUrl`.\nTo link a trace found via the query tool, feed its `trace_id` to `apm-trace-get` and surface the `_posthogUrl` from that response.\nNever hand-construct PostHog URLs.\n\n## Finding traces\n\nUse `posthog:query-apm-spans` to search and filter spans. Note this returns spans, not a tree — pass `query.traceId` or grab a `trace_id` from the results and feed it to `apm-trace-get` for the tree.\n\n### Discover before filtering\n\nBefore constructing filters, discover what's actually in the project:\n\n1. **Confirm services exist** — call `apm-services-list` to see which services have emitted spans.\n2. **Find filterable attributes** — call `apm-attributes-list` with `attribute_type: \"span\"` or `\"resource\"`.\n3. **Get actual values** — call `apm-attribute-values-list` with a key to see the real values in use.\n\nOnly then construct `query-apm-spans` filters. Custom attributes vary per project and cannot be guessed.\n\n### By filters\n\n```json\nposthog:query-apm-spans\n{\n  \"query\": {\n    \"serviceNames\": [\"api-gateway\"],\n    \"dateRange\": {\"date_from\": \"-1h\"},\n    \"filterGroup\": [\n      {\"key\": \"http.status_code\", \"operator\": \"gt\", \"type\": \"span_attribute\", \"value\": \"499\"}\n    ]\n  }\n}\n```\n\n### By trace ID (when known)\n\n```json\nposthog:apm-trace-get\n{\n  \"trace_id\": \"0123456789abcdef0123456789abcdef\"\n}\n```\n\n### Common gotchas\n\n- **Durations are nanoseconds.** 1 second = `1_000_000_000`. Filter values in `query-apm-spans` for `duration` are also nanoseconds.\n- **`status_code == 2` is Error.** `0` is Unset, `1` is OK. Use `OK` to match `{0, 1}` in the UI filter.\n- **`kind`** is an integer 0–5: 0 Unspecified, 1 Internal, 2 Server, 3 Client, 4 Producer, 5 Consumer.\n- **`parent_span_id` of a root span** is `\"0000000000000000\"` (16 zero hex chars, matching the 8-byte span ID width — _not_ the 16-byte trace ID width), not null.\n\n## Parsing large trace results\n\nTrace tool results are JSON. When too large to read inline, Claude Code persists them to a file.\n\n### Persisted file format\n\n```json\n[{ \"type\": \"text\", \"text\": \"{\\\"results\\\": [...], \\\"_posthogUrl\\\": \\\"...\\\"}\" }]\n```\n\nEvery script in `scripts\u002F` unwraps this envelope before parsing.\n\n### Trace JSON structure\n\n```text\nresults (array of span dicts)\n  └── each span:\n        ├── uuid, trace_id, span_id, parent_span_id (hex strings)\n        ├── name, kind (int 0–5), service_name\n        ├── status_code (int 0–2), is_root_span (bool)\n        ├── timestamp, end_time (ISO 8601)\n        ├── duration_nano (int, nanoseconds)\n        ├── attributes (map of span-level OTel attributes, e.g. db.statement, http.url)\n        └── matched_filter (0\u002F1 — 1 if this span matched the query-apm-spans filter, 0 if it\n            only shares a trace with a match; always present, only meaningful from query-apm-spans)\n```\n\n### Available scripts\n\n| Script                                             | Purpose                                              | Usage                                              |\n| -------------------------------------------------- | ---------------------------------------------------- | -------------------------------------------------- |\n| [`print_summary.py`](.\u002Fscripts\u002Fprint_summary.py)   | Trace metadata, services, slowest spans, errors      | `python3 scripts\u002Fprint_summary.py FILE`            |\n| [`print_timeline.py`](.\u002Fscripts\u002Fprint_timeline.py) | DFS-indented tree from `parent_span_id` walk         | `python3 scripts\u002Fprint_timeline.py FILE`           |\n| [`extract_span.py`](.\u002Fscripts\u002Fextract_span.py)     | Full row + parent\u002Fchildren for spans matching a name | `SPAN=\"name\" python3 scripts\u002Fextract_span.py FILE` |\n| [`search_spans.py`](.\u002Fscripts\u002Fsearch_spans.py)     | Find a keyword across name, service_name, IDs        | `SEARCH=\"kw\" python3 scripts\u002Fsearch_spans.py FILE` |\n| [`show_structure.py`](.\u002Fscripts\u002Fshow_structure.py) | Show JSON keys and types without values              | `python3 scripts\u002Fshow_structure.py FILE`           |\n\n## Tips\n\n- Always set `dateRange` on `query-apm-spans` — queries without a time range are slow. Default is `-1h`; widen only when needed.\n- Always include the `_posthogUrl` from `apm-trace-get` in your response so the user can click through to the trace.\n- Span-level attributes **are** in the `apm-trace-get` \u002F `query-apm-spans` payload (each span's `attributes` map). Resource attributes are not — use `apm-attributes-list` (type `resource`) and `apm-attribute-values-list` for those.\n- `is_root_span` is the cheap way to find the trace entry — don't string-match `00000000…`.\n- For aggregates (p95 by operation, slowest children of a span), use `apm-spans-aggregate` for a flat view or `apm-spans-tree` for parent→child edges — don't reach for SQL.\n",{"data":50,"body":51},{"name":4,"description":6},{"type":52,"children":53},"root",[54,63,69,126,133,362,392,398,405,487,500,505,581,587,600,610,829,850,856,861,920,925,986,997,1003,1009,1112,1118,1194,1200,1227,1233,1348,1354,1406,1412,1465,1471,1505,1519,1567,1622,1628,1652,1690,1696,1729,1735,1740,1805,1817,1823,2165,2171,2231,2237,2362,2368,2373,2379,2514,2527,2533,2543,2549,2730,2736,2875],{"type":55,"tag":56,"props":57,"children":59},"element","h1",{"id":58},"exploring-apm-traces-opentelemetry-spans",[60],{"type":61,"value":62},"text","Exploring APM traces (OpenTelemetry spans)",{"type":55,"tag":64,"props":65,"children":66},"p",{},[67],{"type":61,"value":68},"PostHog captures distributed traces from OpenTelemetry. Each trace is a tree of spans representing a request's path through services.",{"type":55,"tag":64,"props":70,"children":71},{},[72,78,80,85,87,92,94,101,103,108,110,116,118,124],{"type":55,"tag":73,"props":74,"children":75},"strong",{},[76],{"type":61,"value":77},"Disambiguation:",{"type":61,"value":79}," This skill is for ",{"type":55,"tag":73,"props":81,"children":82},{},[83],{"type":61,"value":84},"APM \u002F OpenTelemetry traces",{"type":61,"value":86},". Do not confuse with ",{"type":55,"tag":73,"props":88,"children":89},{},[90],{"type":61,"value":91},"AI observability traces",{"type":61,"value":93}," (agent\u002Fmodel ",{"type":55,"tag":95,"props":96,"children":98},"code",{"className":97},[],[99],{"type":61,"value":100},"$ai_*",{"type":61,"value":102}," events) or ",{"type":55,"tag":73,"props":104,"children":105},{},[106],{"type":61,"value":107},"logs",{"type":61,"value":109}," (",{"type":55,"tag":95,"props":111,"children":113},{"className":112},[],[114],{"type":61,"value":115},"posthog:query-logs",{"type":61,"value":117},", ",{"type":55,"tag":95,"props":119,"children":121},{"className":120},[],[122],{"type":61,"value":123},"posthog:logs-*",{"type":61,"value":125},").",{"type":55,"tag":127,"props":128,"children":130},"h2",{"id":129},"available-tools",[131],{"type":61,"value":132},"Available tools",{"type":55,"tag":134,"props":135,"children":136},"table",{},[137,156],{"type":55,"tag":138,"props":139,"children":140},"thead",{},[141],{"type":55,"tag":142,"props":143,"children":144},"tr",{},[145,151],{"type":55,"tag":146,"props":147,"children":148},"th",{},[149],{"type":61,"value":150},"Tool",{"type":55,"tag":146,"props":152,"children":153},{},[154],{"type":61,"value":155},"Purpose",{"type":55,"tag":157,"props":158,"children":159},"tbody",{},[160,178,201,218,243,260,277,294,311,328,345],{"type":55,"tag":142,"props":161,"children":162},{},[163,173],{"type":55,"tag":164,"props":165,"children":166},"td",{},[167],{"type":55,"tag":95,"props":168,"children":170},{"className":169},[],[171],{"type":61,"value":172},"posthog:query-apm-spans",{"type":55,"tag":164,"props":174,"children":175},{},[176],{"type":61,"value":177},"Search and filter spans (compact list view)",{"type":55,"tag":142,"props":179,"children":180},{},[181,190],{"type":55,"tag":164,"props":182,"children":183},{},[184],{"type":55,"tag":95,"props":185,"children":187},{"className":186},[],[188],{"type":61,"value":189},"posthog:apm-trace-get",{"type":55,"tag":164,"props":191,"children":192},{},[193,195],{"type":61,"value":194},"Get the full span list for one hex ",{"type":55,"tag":95,"props":196,"children":198},{"className":197},[],[199],{"type":61,"value":200},"trace_id",{"type":55,"tag":142,"props":202,"children":203},{},[204,213],{"type":55,"tag":164,"props":205,"children":206},{},[207],{"type":55,"tag":95,"props":208,"children":210},{"className":209},[],[211],{"type":61,"value":212},"posthog:apm-spans-aggregate",{"type":55,"tag":164,"props":214,"children":215},{},[216],{"type":61,"value":217},"Per-operation aggregates (count, p50\u002Fp95, errors)",{"type":55,"tag":142,"props":219,"children":220},{},[221,230],{"type":55,"tag":164,"props":222,"children":223},{},[224],{"type":55,"tag":95,"props":225,"children":227},{"className":226},[],[228],{"type":61,"value":229},"posthog:apm-spans-tree",{"type":55,"tag":164,"props":231,"children":232},{},[233,235,241],{"type":61,"value":234},"Call-tree aggregates per ",{"type":55,"tag":95,"props":236,"children":238},{"className":237},[],[239],{"type":61,"value":240},"(parent, child)",{"type":61,"value":242}," edge",{"type":55,"tag":142,"props":244,"children":245},{},[246,255],{"type":55,"tag":164,"props":247,"children":248},{},[249],{"type":55,"tag":95,"props":250,"children":252},{"className":251},[],[253],{"type":61,"value":254},"posthog:apm-spans-count",{"type":55,"tag":164,"props":256,"children":257},{},[258],{"type":61,"value":259},"Scalar span count — cheap filter pre-flight",{"type":55,"tag":142,"props":261,"children":262},{},[263,272],{"type":55,"tag":164,"props":264,"children":265},{},[266],{"type":55,"tag":95,"props":267,"children":269},{"className":268},[],[270],{"type":61,"value":271},"posthog:apm-spans-sparkline",{"type":55,"tag":164,"props":273,"children":274},{},[275],{"type":61,"value":276},"Span counts over time (zero-filled time series)",{"type":55,"tag":142,"props":278,"children":279},{},[280,289],{"type":55,"tag":164,"props":281,"children":282},{},[283],{"type":55,"tag":95,"props":284,"children":286},{"className":285},[],[287],{"type":61,"value":288},"posthog:apm-spans-duration-histogram",{"type":55,"tag":164,"props":290,"children":291},{},[292],{"type":61,"value":293},"Trace counts per log-scale duration bucket",{"type":55,"tag":142,"props":295,"children":296},{},[297,306],{"type":55,"tag":164,"props":298,"children":299},{},[300],{"type":55,"tag":95,"props":301,"children":303},{"className":302},[],[304],{"type":61,"value":305},"posthog:apm-attribute-breakdown",{"type":55,"tag":164,"props":307,"children":308},{},[309],{"type":61,"value":310},"Span counts grouped by one attribute's value",{"type":55,"tag":142,"props":312,"children":313},{},[314,323],{"type":55,"tag":164,"props":315,"children":316},{},[317],{"type":55,"tag":95,"props":318,"children":320},{"className":319},[],[321],{"type":61,"value":322},"posthog:apm-services-list",{"type":55,"tag":164,"props":324,"children":325},{},[326],{"type":61,"value":327},"List distinct service names",{"type":55,"tag":142,"props":329,"children":330},{},[331,340],{"type":55,"tag":164,"props":332,"children":333},{},[334],{"type":55,"tag":95,"props":335,"children":337},{"className":336},[],[338],{"type":61,"value":339},"posthog:apm-attributes-list",{"type":55,"tag":164,"props":341,"children":342},{},[343],{"type":61,"value":344},"List span or resource attribute keys",{"type":55,"tag":142,"props":346,"children":347},{},[348,357],{"type":55,"tag":164,"props":349,"children":350},{},[351],{"type":55,"tag":95,"props":352,"children":354},{"className":353},[],[355],{"type":61,"value":356},"posthog:apm-attribute-values-list",{"type":55,"tag":164,"props":358,"children":359},{},[360],{"type":61,"value":361},"List values for a specific attribute key",{"type":55,"tag":64,"props":363,"children":364},{},[365,367,374,376,382,384,390],{"type":61,"value":366},"See ",{"type":55,"tag":368,"props":369,"children":371},"a",{"href":370},".\u002Freferences\u002Fspans-and-fields.md",[372],{"type":61,"value":373},"references\u002Fspans-and-fields.md",{"type":61,"value":375}," for the response schema and the ",{"type":55,"tag":95,"props":377,"children":379},{"className":378},[],[380],{"type":61,"value":381},"kind",{"type":61,"value":383},"\u002F",{"type":55,"tag":95,"props":385,"children":387},{"className":386},[],[388],{"type":61,"value":389},"status_code",{"type":61,"value":391}," enums.",{"type":55,"tag":127,"props":393,"children":395},{"id":394},"workflow-debug-a-trace-from-a-url",[396],{"type":61,"value":397},"Workflow: debug a trace from a URL",{"type":55,"tag":399,"props":400,"children":402},"h3",{"id":401},"step-1-fetch-the-trace",[403],{"type":61,"value":404},"Step 1 — Fetch the trace",{"type":55,"tag":406,"props":407,"children":412},"pre",{"className":408,"code":409,"language":410,"meta":411,"style":411},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","posthog:apm-trace-get\n{\n  \"trace_id\": \"\u003Chex_trace_id>\"\n}\n","json","",[413],{"type":55,"tag":95,"props":414,"children":415},{"__ignoreMap":411},[416,428,438,478],{"type":55,"tag":417,"props":418,"children":421},"span",{"class":419,"line":420},"line",1,[422],{"type":55,"tag":417,"props":423,"children":425},{"style":424},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[426],{"type":61,"value":427},"posthog:apm-trace-get\n",{"type":55,"tag":417,"props":429,"children":431},{"class":419,"line":430},2,[432],{"type":55,"tag":417,"props":433,"children":435},{"style":434},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[436],{"type":61,"value":437},"{\n",{"type":55,"tag":417,"props":439,"children":441},{"class":419,"line":440},3,[442,447,452,457,462,467,473],{"type":55,"tag":417,"props":443,"children":444},{"style":434},[445],{"type":61,"value":446},"  \"",{"type":55,"tag":417,"props":448,"children":450},{"style":449},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[451],{"type":61,"value":200},{"type":55,"tag":417,"props":453,"children":454},{"style":434},[455],{"type":61,"value":456},"\"",{"type":55,"tag":417,"props":458,"children":459},{"style":434},[460],{"type":61,"value":461},":",{"type":55,"tag":417,"props":463,"children":464},{"style":434},[465],{"type":61,"value":466}," \"",{"type":55,"tag":417,"props":468,"children":470},{"style":469},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[471],{"type":61,"value":472},"\u003Chex_trace_id>",{"type":55,"tag":417,"props":474,"children":475},{"style":434},[476],{"type":61,"value":477},"\"\n",{"type":55,"tag":417,"props":479,"children":481},{"class":419,"line":480},4,[482],{"type":55,"tag":417,"props":483,"children":484},{"style":434},[485],{"type":61,"value":486},"}\n",{"type":55,"tag":64,"props":488,"children":489},{},[490,492,498],{"type":61,"value":491},"The response is ",{"type":55,"tag":95,"props":493,"children":495},{"className":494},[],[496],{"type":61,"value":497},"{ results: [span, span, …], _posthogUrl: \"…\" }",{"type":61,"value":499}," — a flat list of every span in the trace.\nThe list can be very large for fan-out request flows; when it exceeds the inline limit, Claude Code auto-persists it to a file.",{"type":55,"tag":64,"props":501,"children":502},{},[503],{"type":61,"value":504},"From the result you get:",{"type":55,"tag":506,"props":507,"children":508},"ul",{},[509,561],{"type":55,"tag":510,"props":511,"children":512},"li",{},[513,515,521,522,528,529,534,535,540,541,547,548,554,555],{"type":61,"value":514},"Every span with ",{"type":55,"tag":95,"props":516,"children":518},{"className":517},[],[519],{"type":61,"value":520},"name",{"type":61,"value":117},{"type":55,"tag":95,"props":523,"children":525},{"className":524},[],[526],{"type":61,"value":527},"service_name",{"type":61,"value":117},{"type":55,"tag":95,"props":530,"children":532},{"className":531},[],[533],{"type":61,"value":381},{"type":61,"value":117},{"type":55,"tag":95,"props":536,"children":538},{"className":537},[],[539],{"type":61,"value":389},{"type":61,"value":117},{"type":55,"tag":95,"props":542,"children":544},{"className":543},[],[545],{"type":61,"value":546},"parent_span_id",{"type":61,"value":117},{"type":55,"tag":95,"props":549,"children":551},{"className":550},[],[552],{"type":61,"value":553},"duration_nano",{"type":61,"value":117},{"type":55,"tag":95,"props":556,"children":558},{"className":557},[],[559],{"type":61,"value":560},"is_root_span",{"type":55,"tag":510,"props":562,"children":563},{},[564,566,572,574,579],{"type":61,"value":565},"The ",{"type":55,"tag":95,"props":567,"children":569},{"className":568},[],[570],{"type":61,"value":571},"_posthogUrl",{"type":61,"value":573}," — a deep link to this trace in the tracing UI; ",{"type":55,"tag":73,"props":575,"children":576},{},[577],{"type":61,"value":578},"always include this in your response",{"type":61,"value":580}," so the user can click through",{"type":55,"tag":399,"props":582,"children":584},{"id":583},"step-2-parse-large-results-with-scripts",[585],{"type":61,"value":586},"Step 2 — Parse large results with scripts",{"type":55,"tag":64,"props":588,"children":589},{},[590,592,598],{"type":61,"value":591},"When the result is persisted to a file (traces with hundreds of spans across services), use the ",{"type":55,"tag":368,"props":593,"children":595},{"href":594},".\u002Fscripts\u002F",[596],{"type":61,"value":597},"parsing scripts",{"type":61,"value":599}," to explore it.",{"type":55,"tag":64,"props":601,"children":602},{},[603,608],{"type":55,"tag":73,"props":604,"children":605},{},[606],{"type":61,"value":607},"Start with the summary",{"type":61,"value":609}," to get the full picture, then drill into specifics:",{"type":55,"tag":406,"props":611,"children":615},{"className":612,"code":613,"language":614,"meta":411,"style":411},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# 1. Overview: services, span count, slowest spans, errors\npython3 scripts\u002Fprint_summary.py \u002Fpath\u002Fto\u002Fpersisted-file.json\n\n# 2. Indented chronological tree (DFS by parent_span_id)\npython3 scripts\u002Fprint_timeline.py \u002Fpath\u002Fto\u002Fpersisted-file.json\n\n# 3. Drill into a specific span by name\nSPAN=\"HTTP GET \u002Fapi\u002Fusers\" python3 scripts\u002Fextract_span.py \u002Fpath\u002Fto\u002Fpersisted-file.json\n\n# 4. Search for a keyword across span names, services, IDs\nSEARCH=\"keyword\" python3 scripts\u002Fsearch_spans.py \u002Fpath\u002Fto\u002Fpersisted-file.json\n\n# 5. When the JSON shape looks unfamiliar\npython3 scripts\u002Fshow_structure.py \u002Fpath\u002Fto\u002Fpersisted-file.json\n","bash",[616],{"type":55,"tag":95,"props":617,"children":618},{"__ignoreMap":411},[619,628,647,656,664,681,689,698,739,747,756,795,803,812],{"type":55,"tag":417,"props":620,"children":621},{"class":419,"line":420},[622],{"type":55,"tag":417,"props":623,"children":625},{"style":624},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[626],{"type":61,"value":627},"# 1. Overview: services, span count, slowest spans, errors\n",{"type":55,"tag":417,"props":629,"children":630},{"class":419,"line":430},[631,637,642],{"type":55,"tag":417,"props":632,"children":634},{"style":633},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[635],{"type":61,"value":636},"python3",{"type":55,"tag":417,"props":638,"children":639},{"style":469},[640],{"type":61,"value":641}," scripts\u002Fprint_summary.py",{"type":55,"tag":417,"props":643,"children":644},{"style":469},[645],{"type":61,"value":646}," \u002Fpath\u002Fto\u002Fpersisted-file.json\n",{"type":55,"tag":417,"props":648,"children":649},{"class":419,"line":440},[650],{"type":55,"tag":417,"props":651,"children":653},{"emptyLinePlaceholder":652},true,[654],{"type":61,"value":655},"\n",{"type":55,"tag":417,"props":657,"children":658},{"class":419,"line":480},[659],{"type":55,"tag":417,"props":660,"children":661},{"style":624},[662],{"type":61,"value":663},"# 2. Indented chronological tree (DFS by parent_span_id)\n",{"type":55,"tag":417,"props":665,"children":667},{"class":419,"line":666},5,[668,672,677],{"type":55,"tag":417,"props":669,"children":670},{"style":633},[671],{"type":61,"value":636},{"type":55,"tag":417,"props":673,"children":674},{"style":469},[675],{"type":61,"value":676}," scripts\u002Fprint_timeline.py",{"type":55,"tag":417,"props":678,"children":679},{"style":469},[680],{"type":61,"value":646},{"type":55,"tag":417,"props":682,"children":684},{"class":419,"line":683},6,[685],{"type":55,"tag":417,"props":686,"children":687},{"emptyLinePlaceholder":652},[688],{"type":61,"value":655},{"type":55,"tag":417,"props":690,"children":692},{"class":419,"line":691},7,[693],{"type":55,"tag":417,"props":694,"children":695},{"style":624},[696],{"type":61,"value":697},"# 3. Drill into a specific span by name\n",{"type":55,"tag":417,"props":699,"children":701},{"class":419,"line":700},8,[702,707,712,716,721,725,730,735],{"type":55,"tag":417,"props":703,"children":704},{"style":424},[705],{"type":61,"value":706},"SPAN",{"type":55,"tag":417,"props":708,"children":709},{"style":434},[710],{"type":61,"value":711},"=",{"type":55,"tag":417,"props":713,"children":714},{"style":434},[715],{"type":61,"value":456},{"type":55,"tag":417,"props":717,"children":718},{"style":469},[719],{"type":61,"value":720},"HTTP GET \u002Fapi\u002Fusers",{"type":55,"tag":417,"props":722,"children":723},{"style":434},[724],{"type":61,"value":456},{"type":55,"tag":417,"props":726,"children":727},{"style":633},[728],{"type":61,"value":729}," python3",{"type":55,"tag":417,"props":731,"children":732},{"style":469},[733],{"type":61,"value":734}," scripts\u002Fextract_span.py",{"type":55,"tag":417,"props":736,"children":737},{"style":469},[738],{"type":61,"value":646},{"type":55,"tag":417,"props":740,"children":742},{"class":419,"line":741},9,[743],{"type":55,"tag":417,"props":744,"children":745},{"emptyLinePlaceholder":652},[746],{"type":61,"value":655},{"type":55,"tag":417,"props":748,"children":750},{"class":419,"line":749},10,[751],{"type":55,"tag":417,"props":752,"children":753},{"style":624},[754],{"type":61,"value":755},"# 4. Search for a keyword across span names, services, IDs\n",{"type":55,"tag":417,"props":757,"children":759},{"class":419,"line":758},11,[760,765,769,773,778,782,786,791],{"type":55,"tag":417,"props":761,"children":762},{"style":424},[763],{"type":61,"value":764},"SEARCH",{"type":55,"tag":417,"props":766,"children":767},{"style":434},[768],{"type":61,"value":711},{"type":55,"tag":417,"props":770,"children":771},{"style":434},[772],{"type":61,"value":456},{"type":55,"tag":417,"props":774,"children":775},{"style":469},[776],{"type":61,"value":777},"keyword",{"type":55,"tag":417,"props":779,"children":780},{"style":434},[781],{"type":61,"value":456},{"type":55,"tag":417,"props":783,"children":784},{"style":633},[785],{"type":61,"value":729},{"type":55,"tag":417,"props":787,"children":788},{"style":469},[789],{"type":61,"value":790}," scripts\u002Fsearch_spans.py",{"type":55,"tag":417,"props":792,"children":793},{"style":469},[794],{"type":61,"value":646},{"type":55,"tag":417,"props":796,"children":798},{"class":419,"line":797},12,[799],{"type":55,"tag":417,"props":800,"children":801},{"emptyLinePlaceholder":652},[802],{"type":61,"value":655},{"type":55,"tag":417,"props":804,"children":806},{"class":419,"line":805},13,[807],{"type":55,"tag":417,"props":808,"children":809},{"style":624},[810],{"type":61,"value":811},"# 5. When the JSON shape looks unfamiliar\n",{"type":55,"tag":417,"props":813,"children":815},{"class":419,"line":814},14,[816,820,825],{"type":55,"tag":417,"props":817,"children":818},{"style":633},[819],{"type":61,"value":636},{"type":55,"tag":417,"props":821,"children":822},{"style":469},[823],{"type":61,"value":824}," scripts\u002Fshow_structure.py",{"type":55,"tag":417,"props":826,"children":827},{"style":469},[828],{"type":61,"value":646},{"type":55,"tag":64,"props":830,"children":831},{},[832,834,840,842,848],{"type":61,"value":833},"All scripts support ",{"type":55,"tag":95,"props":835,"children":837},{"className":836},[],[838],{"type":61,"value":839},"MAX_LEN=N",{"type":61,"value":841}," env var to control truncation (",{"type":55,"tag":95,"props":843,"children":845},{"className":844},[],[846],{"type":61,"value":847},"0",{"type":61,"value":849}," = unlimited).",{"type":55,"tag":127,"props":851,"children":853},{"id":852},"tree-reconstruction-parent_span_id-span_id",[854],{"type":61,"value":855},"Tree reconstruction (parent_span_id → span_id)",{"type":55,"tag":64,"props":857,"children":858},{},[859],{"type":61,"value":860},"The flat span list is a tree. Each span carries:",{"type":55,"tag":506,"props":862,"children":863},{},[864,874,885,910],{"type":55,"tag":510,"props":865,"children":866},{},[867,872],{"type":55,"tag":95,"props":868,"children":870},{"className":869},[],[871],{"type":61,"value":200},{"type":61,"value":873}," — same on every span in the trace",{"type":55,"tag":510,"props":875,"children":876},{},[877,883],{"type":55,"tag":95,"props":878,"children":880},{"className":879},[],[881],{"type":61,"value":882},"span_id",{"type":61,"value":884}," — this span's unique hex ID",{"type":55,"tag":510,"props":886,"children":887},{},[888,893,895,900,902,908],{"type":55,"tag":95,"props":889,"children":891},{"className":890},[],[892],{"type":61,"value":546},{"type":61,"value":894}," — points to the parent's ",{"type":55,"tag":95,"props":896,"children":898},{"className":897},[],[899],{"type":61,"value":882},{"type":61,"value":901}," (zero-padded hex ",{"type":55,"tag":95,"props":903,"children":905},{"className":904},[],[906],{"type":61,"value":907},"000…000",{"type":61,"value":909}," for the root)",{"type":55,"tag":510,"props":911,"children":912},{},[913,918],{"type":55,"tag":95,"props":914,"children":916},{"className":915},[],[917],{"type":61,"value":560},{"type":61,"value":919}," — convenience flag for the trace entry",{"type":55,"tag":64,"props":921,"children":922},{},[923],{"type":61,"value":924},"To rebuild the tree:",{"type":55,"tag":926,"props":927,"children":928},"ol",{},[929,956,974],{"type":55,"tag":510,"props":930,"children":931},{},[932,934,939,941,947,949,954],{"type":61,"value":933},"Spans where ",{"type":55,"tag":95,"props":935,"children":937},{"className":936},[],[938],{"type":61,"value":560},{"type":61,"value":940}," is true (or ",{"type":55,"tag":95,"props":942,"children":944},{"className":943},[],[945],{"type":61,"value":946},"parent_span_id == \"00000000…\"",{"type":61,"value":948},") are ",{"type":55,"tag":73,"props":950,"children":951},{},[952],{"type":61,"value":953},"root spans",{"type":61,"value":955},".",{"type":55,"tag":510,"props":957,"children":958},{},[959,961,966,968,973],{"type":61,"value":960},"Every other span is a child of the span whose ",{"type":55,"tag":95,"props":962,"children":964},{"className":963},[],[965],{"type":61,"value":882},{"type":61,"value":967}," matches its ",{"type":55,"tag":95,"props":969,"children":971},{"className":970},[],[972],{"type":61,"value":546},{"type":61,"value":955},{"type":55,"tag":510,"props":975,"children":976},{},[977,979,984],{"type":61,"value":978},"Group by ",{"type":55,"tag":95,"props":980,"children":982},{"className":981},[],[983],{"type":61,"value":546},{"type":61,"value":985},", walk from each root downward.",{"type":55,"tag":64,"props":987,"children":988},{},[989,995],{"type":55,"tag":95,"props":990,"children":992},{"className":991},[],[993],{"type":61,"value":994},"scripts\u002Fprint_timeline.py",{"type":61,"value":996}," does this for you and prints a DFS-indented tree.",{"type":55,"tag":127,"props":998,"children":1000},{"id":999},"investigation-patterns",[1001],{"type":61,"value":1002},"Investigation patterns",{"type":55,"tag":399,"props":1004,"children":1006},{"id":1005},"where-is-time-going",[1007],{"type":61,"value":1008},"\"Where is time going?\"",{"type":55,"tag":926,"props":1010,"children":1011},{},[1012,1047,1066,1079,1091],{"type":55,"tag":510,"props":1013,"children":1014},{},[1015,1017,1023,1025,1031,1033,1038,1040,1045],{"type":61,"value":1016},"Every span from ",{"type":55,"tag":95,"props":1018,"children":1020},{"className":1019},[],[1021],{"type":61,"value":1022},"apm-trace-get",{"type":61,"value":1024}," carries ",{"type":55,"tag":95,"props":1026,"children":1028},{"className":1027},[],[1029],{"type":61,"value":1030},"self_time_nano",{"type":61,"value":1032}," — duration not covered by children. Sort by it: the top span is where wall-clock actually went. A parent with large ",{"type":55,"tag":95,"props":1034,"children":1036},{"className":1035},[],[1037],{"type":61,"value":1030},{"type":61,"value":1039}," is an ",{"type":55,"tag":73,"props":1041,"children":1042},{},[1043],{"type":61,"value":1044},"uninstrumented gap",{"type":61,"value":1046}," (the work happened inside it, not in any recorded child).",{"type":55,"tag":510,"props":1048,"children":1049},{},[1050,1052,1058,1060,1065],{"type":61,"value":1051},"Run ",{"type":55,"tag":95,"props":1053,"children":1055},{"className":1054},[],[1056],{"type":61,"value":1057},"print_summary.py",{"type":61,"value":1059}," — it surfaces the top-5 slowest spans by ",{"type":55,"tag":95,"props":1061,"children":1063},{"className":1062},[],[1064],{"type":61,"value":553},{"type":61,"value":955},{"type":55,"tag":510,"props":1067,"children":1068},{},[1069,1071,1077],{"type":61,"value":1070},"For a noisy trace, run ",{"type":55,"tag":95,"props":1072,"children":1074},{"className":1073},[],[1075],{"type":61,"value":1076},"print_timeline.py",{"type":61,"value":1078}," and scan the indented durations — you can see whether time is dominated by one child span or fan-out across many.",{"type":55,"tag":510,"props":1080,"children":1081},{},[1082,1084,1090],{"type":61,"value":1083},"To dig into one slow span, ",{"type":55,"tag":95,"props":1085,"children":1087},{"className":1086},[],[1088],{"type":61,"value":1089},"SPAN=\"\u003Cname>\" python3 scripts\u002Fextract_span.py FILE",{"type":61,"value":955},{"type":55,"tag":510,"props":1092,"children":1093},{},[1094,1096,1102,1104,1110],{"type":61,"value":1095},"For aggregate \"which child dominates\" questions use ",{"type":55,"tag":95,"props":1097,"children":1099},{"className":1098},[],[1100],{"type":61,"value":1101},"apm-spans-tree",{"type":61,"value":1103}," and read ",{"type":55,"tag":95,"props":1105,"children":1107},{"className":1106},[],[1108],{"type":61,"value":1109},"calls_per_parent_invocation",{"type":61,"value":1111}," — it separates a child that's slow per call from one that merely runs 20× per parent.",{"type":55,"tag":399,"props":1113,"children":1115},{"id":1114},"where-did-the-error-happen",[1116],{"type":61,"value":1117},"\"Where did the error happen?\"",{"type":55,"tag":926,"props":1119,"children":1120},{},[1121,1139,1151],{"type":55,"tag":510,"props":1122,"children":1123},{},[1124,1129,1131,1137],{"type":55,"tag":95,"props":1125,"children":1127},{"className":1126},[],[1128],{"type":61,"value":1057},{"type":61,"value":1130}," lists every span with ",{"type":55,"tag":95,"props":1132,"children":1134},{"className":1133},[],[1135],{"type":61,"value":1136},"status_code == 2",{"type":61,"value":1138}," (Error). Each entry shows service, span name, and parent context.",{"type":55,"tag":510,"props":1140,"children":1141},{},[1142,1144,1149],{"type":61,"value":1143},"Walk up the tree from an error span via ",{"type":55,"tag":95,"props":1145,"children":1147},{"className":1146},[],[1148],{"type":61,"value":546},{"type":61,"value":1150}," to see what request path led there.",{"type":55,"tag":510,"props":1152,"children":1153},{},[1154,1156,1162,1164,1170,1171,1177,1179,1184,1186,1192],{"type":61,"value":1155},"Error detail lives in each span's ",{"type":55,"tag":95,"props":1157,"children":1159},{"className":1158},[],[1160],{"type":61,"value":1161},"attributes",{"type":61,"value":1163}," map (e.g. ",{"type":55,"tag":95,"props":1165,"children":1167},{"className":1166},[],[1168],{"type":61,"value":1169},"exception.message",{"type":61,"value":117},{"type":55,"tag":95,"props":1172,"children":1174},{"className":1173},[],[1175],{"type":61,"value":1176},"exception.type",{"type":61,"value":1178},"), which ",{"type":55,"tag":73,"props":1180,"children":1181},{},[1182],{"type":61,"value":1183},"is",{"type":61,"value":1185}," returned in the trace payload — read it directly off the error span. ",{"type":55,"tag":95,"props":1187,"children":1189},{"className":1188},[],[1190],{"type":61,"value":1191},"apm-attribute-values-list",{"type":61,"value":1193}," is for discovering values across spans, not a prerequisite for reading one span's attributes.",{"type":55,"tag":399,"props":1195,"children":1197},{"id":1196},"did-the-request-hit-service-x",[1198],{"type":61,"value":1199},"\"Did the request hit service X?\"",{"type":55,"tag":926,"props":1201,"children":1202},{},[1203,1214],{"type":55,"tag":510,"props":1204,"children":1205},{},[1206,1207,1212],{"type":61,"value":1051},{"type":55,"tag":95,"props":1208,"children":1210},{"className":1209},[],[1211],{"type":61,"value":1057},{"type":61,"value":1213}," — it prints the set of services involved in the trace.",{"type":55,"tag":510,"props":1215,"children":1216},{},[1217,1219,1225],{"type":61,"value":1218},"If service X is missing, the request never reached it (or instrumentation is missing — check ",{"type":55,"tag":95,"props":1220,"children":1222},{"className":1221},[],[1223],{"type":61,"value":1224},"apm-services-list",{"type":61,"value":1226}," to confirm X has emitted spans recently at all).",{"type":55,"tag":399,"props":1228,"children":1230},{"id":1229},"whats-different-about-the-bad-spans-over-represented-values",[1231],{"type":61,"value":1232},"\"What's different about the bad spans?\" (over-represented values)",{"type":55,"tag":926,"props":1234,"children":1235},{},[1236,1265,1315,1335],{"type":55,"tag":510,"props":1237,"children":1238},{},[1239,1241,1247,1249,1255,1257,1263],{"type":61,"value":1240},"Scope to the bad population: ",{"type":55,"tag":95,"props":1242,"children":1244},{"className":1243},[],[1245],{"type":61,"value":1246},"filterGroup",{"type":61,"value":1248}," with ",{"type":55,"tag":95,"props":1250,"children":1252},{"className":1251},[],[1253],{"type":61,"value":1254},"status_code = Error",{"type":61,"value":1256},", or a ",{"type":55,"tag":95,"props":1258,"children":1260},{"className":1259},[],[1261],{"type":61,"value":1262},"duration",{"type":61,"value":1264}," threshold.",{"type":55,"tag":510,"props":1266,"children":1267},{},[1268,1270,1276,1278,1284,1285,1291,1292,1298,1300,1306,1308,1314],{"type":61,"value":1269},"Discover candidate keys with ",{"type":55,"tag":95,"props":1271,"children":1273},{"className":1272},[],[1274],{"type":61,"value":1275},"apm-attributes-list",{"type":61,"value":1277}," — typical suspects: ",{"type":55,"tag":95,"props":1279,"children":1281},{"className":1280},[],[1282],{"type":61,"value":1283},"server.address",{"type":61,"value":117},{"type":55,"tag":95,"props":1286,"children":1288},{"className":1287},[],[1289],{"type":61,"value":1290},"http.response.status_code",{"type":61,"value":117},{"type":55,"tag":95,"props":1293,"children":1295},{"className":1294},[],[1296],{"type":61,"value":1297},"db.system",{"type":61,"value":1299},", resource keys like ",{"type":55,"tag":95,"props":1301,"children":1303},{"className":1302},[],[1304],{"type":61,"value":1305},"k8s.pod.name",{"type":61,"value":1307}," \u002F ",{"type":55,"tag":95,"props":1309,"children":1311},{"className":1310},[],[1312],{"type":61,"value":1313},"service.version",{"type":61,"value":955},{"type":55,"tag":510,"props":1316,"children":1317},{},[1318,1319,1325,1327,1333],{"type":61,"value":1051},{"type":55,"tag":95,"props":1320,"children":1322},{"className":1321},[],[1323],{"type":61,"value":1324},"apm-attribute-breakdown",{"type":61,"value":1326}," per candidate key on the bad set. A value owning most of the ",{"type":55,"tag":95,"props":1328,"children":1330},{"className":1329},[],[1331],{"type":61,"value":1332},"count",{"type":61,"value":1334}," is the signature.",{"type":55,"tag":510,"props":1336,"children":1337},{},[1338,1340,1346],{"type":61,"value":1339},"Confirm over-representation: re-run without the bad-set filter (or compare ",{"type":55,"tag":95,"props":1341,"children":1343},{"className":1342},[],[1344],{"type":61,"value":1345},"error_count \u002F count",{"type":61,"value":1347}," per row). A value at 95% of errors but 10% of traffic is the culprit; one at 95% of both is just volume.",{"type":55,"tag":399,"props":1349,"children":1351},{"id":1350},"when-did-it-spike-trends-over-time",[1352],{"type":61,"value":1353},"\"When did it spike?\" (trends over time)",{"type":55,"tag":926,"props":1355,"children":1356},{},[1357,1368,1381,1386],{"type":55,"tag":510,"props":1358,"children":1359},{},[1360,1366],{"type":55,"tag":95,"props":1361,"children":1363},{"className":1362},[],[1364],{"type":61,"value":1365},"apm-spans-sparkline",{"type":61,"value":1367}," with your filters → total counts per time bucket (zero-filled, ~50 adaptive buckets per window).",{"type":55,"tag":510,"props":1369,"children":1370},{},[1371,1373,1379],{"type":61,"value":1372},"The same call with ",{"type":55,"tag":95,"props":1374,"children":1376},{"className":1375},[],[1377],{"type":61,"value":1378},"statusCodes: [2]",{"type":61,"value":1380}," → error counts per bucket.",{"type":55,"tag":510,"props":1382,"children":1383},{},[1384],{"type":61,"value":1385},"Error rate per bucket = errors \u002F total; the bucket where the ratio jumps is when the spike started.",{"type":55,"tag":510,"props":1387,"children":1388},{},[1389,1391,1397,1399,1405],{"type":61,"value":1390},"Zoom in: re-run with a narrower ",{"type":55,"tag":95,"props":1392,"children":1394},{"className":1393},[],[1395],{"type":61,"value":1396},"dateRange",{"type":61,"value":1398}," around that bucket, then pull raw spans via ",{"type":55,"tag":95,"props":1400,"children":1402},{"className":1401},[],[1403],{"type":61,"value":1404},"query-apm-spans",{"type":61,"value":955},{"type":55,"tag":399,"props":1407,"children":1409},{"id":1408},"what-does-the-latency-distribution-look-like",[1410],{"type":61,"value":1411},"\"What does the latency distribution look like?\"",{"type":55,"tag":926,"props":1413,"children":1414},{},[1415,1426,1439],{"type":55,"tag":510,"props":1416,"children":1417},{},[1418,1424],{"type":55,"tag":95,"props":1419,"children":1421},{"className":1420},[],[1422],{"type":61,"value":1423},"apm-spans-duration-histogram",{"type":61,"value":1425}," → trace counts per log-scale (1-2-5 series) duration bucket of the ROOT span.",{"type":55,"tag":510,"props":1427,"children":1428},{},[1429,1431,1437],{"type":61,"value":1430},"A second hump or a fat tail = a distinct slow population; note its ",{"type":55,"tag":95,"props":1432,"children":1434},{"className":1433},[],[1435],{"type":61,"value":1436},"bucket_ns",{"type":61,"value":1438}," range.",{"type":55,"tag":510,"props":1440,"children":1441},{},[1442,1444,1449,1451,1456,1458,1464],{"type":61,"value":1443},"Fetch the actual slow traces with ",{"type":55,"tag":95,"props":1445,"children":1447},{"className":1446},[],[1448],{"type":61,"value":1404},{"type":61,"value":1450}," using a ",{"type":55,"tag":95,"props":1452,"children":1454},{"className":1453},[],[1455],{"type":61,"value":1262},{"type":61,"value":1457}," filter (nanoseconds) and ",{"type":55,"tag":95,"props":1459,"children":1461},{"className":1460},[],[1462],{"type":61,"value":1463},"orderBy: \"duration\"",{"type":61,"value":955},{"type":55,"tag":399,"props":1466,"children":1468},{"id":1467},"did-the-fan-out-look-right",[1469],{"type":61,"value":1470},"\"Did the fan-out look right?\"",{"type":55,"tag":926,"props":1472,"children":1473},{},[1474,1484],{"type":55,"tag":510,"props":1475,"children":1476},{},[1477,1482],{"type":55,"tag":95,"props":1478,"children":1480},{"className":1479},[],[1481],{"type":61,"value":1076},{"type":61,"value":1483}," shows the indentation — wide trees mean parallel calls, deep trees mean sequential dependencies.",{"type":55,"tag":510,"props":1485,"children":1486},{},[1487,1489,1495,1497,1503],{"type":61,"value":1488},"Look for spans of kind ",{"type":55,"tag":95,"props":1490,"children":1492},{"className":1491},[],[1493],{"type":61,"value":1494},"Client",{"type":61,"value":1496}," (3) followed by matching ",{"type":55,"tag":95,"props":1498,"children":1500},{"className":1499},[],[1501],{"type":61,"value":1502},"Server",{"type":61,"value":1504}," (2) spans on the called service — that's a synchronous downstream call.",{"type":55,"tag":399,"props":1506,"children":1508},{"id":1507},"searching-by-attribute-eg-httpmethodpost",[1509,1511,1517],{"type":61,"value":1510},"Searching by attribute (e.g. ",{"type":55,"tag":95,"props":1512,"children":1514},{"className":1513},[],[1515],{"type":61,"value":1516},"http.method=POST",{"type":61,"value":1518},")",{"type":55,"tag":64,"props":1520,"children":1521},{},[1522,1524,1529,1531,1537,1538,1544,1546,1551,1553,1558,1560,1565],{"type":61,"value":1523},"Each span carries an ",{"type":55,"tag":95,"props":1525,"children":1527},{"className":1526},[],[1528],{"type":61,"value":1161},{"type":61,"value":1530}," map (span-level OTel attributes like ",{"type":55,"tag":95,"props":1532,"children":1534},{"className":1533},[],[1535],{"type":61,"value":1536},"http.method",{"type":61,"value":117},{"type":55,"tag":95,"props":1539,"children":1541},{"className":1540},[],[1542],{"type":61,"value":1543},"db.statement",{"type":61,"value":1545},") ",{"type":55,"tag":73,"props":1547,"children":1548},{},[1549],{"type":61,"value":1550},"in the payload",{"type":61,"value":1552}," — so for a span you already have, just read it. ",{"type":55,"tag":73,"props":1554,"children":1555},{},[1556],{"type":61,"value":1557},"Resource",{"type":61,"value":1559}," attributes (k8s labels, ",{"type":55,"tag":95,"props":1561,"children":1563},{"className":1562},[],[1564],{"type":61,"value":1313},{"type":61,"value":1566},") are not in the payload. To filter the whole dataset by an attribute:",{"type":55,"tag":926,"props":1568,"children":1569},{},[1570,1588],{"type":55,"tag":510,"props":1571,"children":1572},{},[1573,1575,1580,1581,1586],{"type":61,"value":1574},"Use ",{"type":55,"tag":95,"props":1576,"children":1578},{"className":1577},[],[1579],{"type":61,"value":1275},{"type":61,"value":1307},{"type":55,"tag":95,"props":1582,"children":1584},{"className":1583},[],[1585],{"type":61,"value":1191},{"type":61,"value":1587}," to discover keys and values (resource attributes especially).",{"type":55,"tag":510,"props":1589,"children":1590},{},[1591,1593,1598,1600,1605,1607,1613,1615,1621],{"type":61,"value":1592},"Re-issue ",{"type":55,"tag":95,"props":1594,"children":1596},{"className":1595},[],[1597],{"type":61,"value":1404},{"type":61,"value":1599}," with a ",{"type":55,"tag":95,"props":1601,"children":1603},{"className":1602},[],[1604],{"type":61,"value":1246},{"type":61,"value":1606}," entry of type ",{"type":55,"tag":95,"props":1608,"children":1610},{"className":1609},[],[1611],{"type":61,"value":1612},"span_attribute",{"type":61,"value":1614}," or ",{"type":55,"tag":95,"props":1616,"children":1618},{"className":1617},[],[1619],{"type":61,"value":1620},"span_resource_attribute",{"type":61,"value":955},{"type":55,"tag":127,"props":1623,"children":1625},{"id":1624},"constructing-ui-links",[1626],{"type":61,"value":1627},"Constructing UI links",{"type":55,"tag":64,"props":1629,"children":1630},{},[1631,1636,1638,1643,1645,1650],{"type":55,"tag":95,"props":1632,"children":1634},{"className":1633},[],[1635],{"type":61,"value":1022},{"type":61,"value":1637}," returns a ",{"type":55,"tag":95,"props":1639,"children":1641},{"className":1640},[],[1642],{"type":61,"value":571},{"type":61,"value":1644}," deep link that opens the trace in the tracing UI — ",{"type":55,"tag":73,"props":1646,"children":1647},{},[1648],{"type":61,"value":1649},"always surface this to the user",{"type":61,"value":1651}," so they can verify in the PostHog UI.",{"type":55,"tag":64,"props":1653,"children":1654},{},[1655,1660,1662,1667,1669,1674,1676,1681,1683,1688],{"type":55,"tag":95,"props":1656,"children":1658},{"className":1657},[],[1659],{"type":61,"value":1404},{"type":61,"value":1661}," does not return ",{"type":55,"tag":95,"props":1663,"children":1665},{"className":1664},[],[1666],{"type":61,"value":571},{"type":61,"value":1668},".\nTo link a trace found via the query tool, feed its ",{"type":55,"tag":95,"props":1670,"children":1672},{"className":1671},[],[1673],{"type":61,"value":200},{"type":61,"value":1675}," to ",{"type":55,"tag":95,"props":1677,"children":1679},{"className":1678},[],[1680],{"type":61,"value":1022},{"type":61,"value":1682}," and surface the ",{"type":55,"tag":95,"props":1684,"children":1686},{"className":1685},[],[1687],{"type":61,"value":571},{"type":61,"value":1689}," from that response.\nNever hand-construct PostHog URLs.",{"type":55,"tag":127,"props":1691,"children":1693},{"id":1692},"finding-traces",[1694],{"type":61,"value":1695},"Finding traces",{"type":55,"tag":64,"props":1697,"children":1698},{},[1699,1700,1705,1707,1713,1715,1720,1722,1727],{"type":61,"value":1574},{"type":55,"tag":95,"props":1701,"children":1703},{"className":1702},[],[1704],{"type":61,"value":172},{"type":61,"value":1706}," to search and filter spans. Note this returns spans, not a tree — pass ",{"type":55,"tag":95,"props":1708,"children":1710},{"className":1709},[],[1711],{"type":61,"value":1712},"query.traceId",{"type":61,"value":1714}," or grab a ",{"type":55,"tag":95,"props":1716,"children":1718},{"className":1717},[],[1719],{"type":61,"value":200},{"type":61,"value":1721}," from the results and feed it to ",{"type":55,"tag":95,"props":1723,"children":1725},{"className":1724},[],[1726],{"type":61,"value":1022},{"type":61,"value":1728}," for the tree.",{"type":55,"tag":399,"props":1730,"children":1732},{"id":1731},"discover-before-filtering",[1733],{"type":61,"value":1734},"Discover before filtering",{"type":55,"tag":64,"props":1736,"children":1737},{},[1738],{"type":61,"value":1739},"Before constructing filters, discover what's actually in the project:",{"type":55,"tag":926,"props":1741,"children":1742},{},[1743,1760,1789],{"type":55,"tag":510,"props":1744,"children":1745},{},[1746,1751,1753,1758],{"type":55,"tag":73,"props":1747,"children":1748},{},[1749],{"type":61,"value":1750},"Confirm services exist",{"type":61,"value":1752}," — call ",{"type":55,"tag":95,"props":1754,"children":1756},{"className":1755},[],[1757],{"type":61,"value":1224},{"type":61,"value":1759}," to see which services have emitted spans.",{"type":55,"tag":510,"props":1761,"children":1762},{},[1763,1768,1769,1774,1775,1781,1782,1788],{"type":55,"tag":73,"props":1764,"children":1765},{},[1766],{"type":61,"value":1767},"Find filterable attributes",{"type":61,"value":1752},{"type":55,"tag":95,"props":1770,"children":1772},{"className":1771},[],[1773],{"type":61,"value":1275},{"type":61,"value":1248},{"type":55,"tag":95,"props":1776,"children":1778},{"className":1777},[],[1779],{"type":61,"value":1780},"attribute_type: \"span\"",{"type":61,"value":1614},{"type":55,"tag":95,"props":1783,"children":1785},{"className":1784},[],[1786],{"type":61,"value":1787},"\"resource\"",{"type":61,"value":955},{"type":55,"tag":510,"props":1790,"children":1791},{},[1792,1797,1798,1803],{"type":55,"tag":73,"props":1793,"children":1794},{},[1795],{"type":61,"value":1796},"Get actual values",{"type":61,"value":1752},{"type":55,"tag":95,"props":1799,"children":1801},{"className":1800},[],[1802],{"type":61,"value":1191},{"type":61,"value":1804}," with a key to see the real values in use.",{"type":55,"tag":64,"props":1806,"children":1807},{},[1808,1810,1815],{"type":61,"value":1809},"Only then construct ",{"type":55,"tag":95,"props":1811,"children":1813},{"className":1812},[],[1814],{"type":61,"value":1404},{"type":61,"value":1816}," filters. Custom attributes vary per project and cannot be guessed.",{"type":55,"tag":399,"props":1818,"children":1820},{"id":1819},"by-filters",[1821],{"type":61,"value":1822},"By filters",{"type":55,"tag":406,"props":1824,"children":1826},{"className":408,"code":1825,"language":410,"meta":411,"style":411},"posthog:query-apm-spans\n{\n  \"query\": {\n    \"serviceNames\": [\"api-gateway\"],\n    \"dateRange\": {\"date_from\": \"-1h\"},\n    \"filterGroup\": [\n      {\"key\": \"http.status_code\", \"operator\": \"gt\", \"type\": \"span_attribute\", \"value\": \"499\"}\n    ]\n  }\n}\n",[1827],{"type":55,"tag":95,"props":1828,"children":1829},{"__ignoreMap":411},[1830,1838,1845,1870,1914,1974,1998,2142,2150,2158],{"type":55,"tag":417,"props":1831,"children":1832},{"class":419,"line":420},[1833],{"type":55,"tag":417,"props":1834,"children":1835},{"style":424},[1836],{"type":61,"value":1837},"posthog:query-apm-spans\n",{"type":55,"tag":417,"props":1839,"children":1840},{"class":419,"line":430},[1841],{"type":55,"tag":417,"props":1842,"children":1843},{"style":434},[1844],{"type":61,"value":437},{"type":55,"tag":417,"props":1846,"children":1847},{"class":419,"line":440},[1848,1852,1857,1861,1865],{"type":55,"tag":417,"props":1849,"children":1850},{"style":434},[1851],{"type":61,"value":446},{"type":55,"tag":417,"props":1853,"children":1854},{"style":449},[1855],{"type":61,"value":1856},"query",{"type":55,"tag":417,"props":1858,"children":1859},{"style":434},[1860],{"type":61,"value":456},{"type":55,"tag":417,"props":1862,"children":1863},{"style":434},[1864],{"type":61,"value":461},{"type":55,"tag":417,"props":1866,"children":1867},{"style":434},[1868],{"type":61,"value":1869}," {\n",{"type":55,"tag":417,"props":1871,"children":1872},{"class":419,"line":480},[1873,1878,1883,1887,1891,1896,1900,1905,1909],{"type":55,"tag":417,"props":1874,"children":1875},{"style":434},[1876],{"type":61,"value":1877},"    \"",{"type":55,"tag":417,"props":1879,"children":1880},{"style":633},[1881],{"type":61,"value":1882},"serviceNames",{"type":55,"tag":417,"props":1884,"children":1885},{"style":434},[1886],{"type":61,"value":456},{"type":55,"tag":417,"props":1888,"children":1889},{"style":434},[1890],{"type":61,"value":461},{"type":55,"tag":417,"props":1892,"children":1893},{"style":434},[1894],{"type":61,"value":1895}," [",{"type":55,"tag":417,"props":1897,"children":1898},{"style":434},[1899],{"type":61,"value":456},{"type":55,"tag":417,"props":1901,"children":1902},{"style":469},[1903],{"type":61,"value":1904},"api-gateway",{"type":55,"tag":417,"props":1906,"children":1907},{"style":434},[1908],{"type":61,"value":456},{"type":55,"tag":417,"props":1910,"children":1911},{"style":434},[1912],{"type":61,"value":1913},"],\n",{"type":55,"tag":417,"props":1915,"children":1916},{"class":419,"line":666},[1917,1921,1925,1929,1933,1938,1942,1948,1952,1956,1960,1965,1969],{"type":55,"tag":417,"props":1918,"children":1919},{"style":434},[1920],{"type":61,"value":1877},{"type":55,"tag":417,"props":1922,"children":1923},{"style":633},[1924],{"type":61,"value":1396},{"type":55,"tag":417,"props":1926,"children":1927},{"style":434},[1928],{"type":61,"value":456},{"type":55,"tag":417,"props":1930,"children":1931},{"style":434},[1932],{"type":61,"value":461},{"type":55,"tag":417,"props":1934,"children":1935},{"style":434},[1936],{"type":61,"value":1937}," {",{"type":55,"tag":417,"props":1939,"children":1940},{"style":434},[1941],{"type":61,"value":456},{"type":55,"tag":417,"props":1943,"children":1945},{"style":1944},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1946],{"type":61,"value":1947},"date_from",{"type":55,"tag":417,"props":1949,"children":1950},{"style":434},[1951],{"type":61,"value":456},{"type":55,"tag":417,"props":1953,"children":1954},{"style":434},[1955],{"type":61,"value":461},{"type":55,"tag":417,"props":1957,"children":1958},{"style":434},[1959],{"type":61,"value":466},{"type":55,"tag":417,"props":1961,"children":1962},{"style":469},[1963],{"type":61,"value":1964},"-1h",{"type":55,"tag":417,"props":1966,"children":1967},{"style":434},[1968],{"type":61,"value":456},{"type":55,"tag":417,"props":1970,"children":1971},{"style":434},[1972],{"type":61,"value":1973},"},\n",{"type":55,"tag":417,"props":1975,"children":1976},{"class":419,"line":683},[1977,1981,1985,1989,1993],{"type":55,"tag":417,"props":1978,"children":1979},{"style":434},[1980],{"type":61,"value":1877},{"type":55,"tag":417,"props":1982,"children":1983},{"style":633},[1984],{"type":61,"value":1246},{"type":55,"tag":417,"props":1986,"children":1987},{"style":434},[1988],{"type":61,"value":456},{"type":55,"tag":417,"props":1990,"children":1991},{"style":434},[1992],{"type":61,"value":461},{"type":55,"tag":417,"props":1994,"children":1995},{"style":434},[1996],{"type":61,"value":1997}," [\n",{"type":55,"tag":417,"props":1999,"children":2000},{"class":419,"line":691},[2001,2006,2010,2015,2019,2023,2027,2032,2036,2041,2045,2050,2054,2058,2062,2067,2071,2075,2079,2084,2088,2092,2096,2100,2104,2108,2112,2117,2121,2125,2129,2134,2138],{"type":55,"tag":417,"props":2002,"children":2003},{"style":434},[2004],{"type":61,"value":2005},"      {",{"type":55,"tag":417,"props":2007,"children":2008},{"style":434},[2009],{"type":61,"value":456},{"type":55,"tag":417,"props":2011,"children":2012},{"style":1944},[2013],{"type":61,"value":2014},"key",{"type":55,"tag":417,"props":2016,"children":2017},{"style":434},[2018],{"type":61,"value":456},{"type":55,"tag":417,"props":2020,"children":2021},{"style":434},[2022],{"type":61,"value":461},{"type":55,"tag":417,"props":2024,"children":2025},{"style":434},[2026],{"type":61,"value":466},{"type":55,"tag":417,"props":2028,"children":2029},{"style":469},[2030],{"type":61,"value":2031},"http.status_code",{"type":55,"tag":417,"props":2033,"children":2034},{"style":434},[2035],{"type":61,"value":456},{"type":55,"tag":417,"props":2037,"children":2038},{"style":434},[2039],{"type":61,"value":2040},",",{"type":55,"tag":417,"props":2042,"children":2043},{"style":434},[2044],{"type":61,"value":466},{"type":55,"tag":417,"props":2046,"children":2047},{"style":1944},[2048],{"type":61,"value":2049},"operator",{"type":55,"tag":417,"props":2051,"children":2052},{"style":434},[2053],{"type":61,"value":456},{"type":55,"tag":417,"props":2055,"children":2056},{"style":434},[2057],{"type":61,"value":461},{"type":55,"tag":417,"props":2059,"children":2060},{"style":434},[2061],{"type":61,"value":466},{"type":55,"tag":417,"props":2063,"children":2064},{"style":469},[2065],{"type":61,"value":2066},"gt",{"type":55,"tag":417,"props":2068,"children":2069},{"style":434},[2070],{"type":61,"value":456},{"type":55,"tag":417,"props":2072,"children":2073},{"style":434},[2074],{"type":61,"value":2040},{"type":55,"tag":417,"props":2076,"children":2077},{"style":434},[2078],{"type":61,"value":466},{"type":55,"tag":417,"props":2080,"children":2081},{"style":1944},[2082],{"type":61,"value":2083},"type",{"type":55,"tag":417,"props":2085,"children":2086},{"style":434},[2087],{"type":61,"value":456},{"type":55,"tag":417,"props":2089,"children":2090},{"style":434},[2091],{"type":61,"value":461},{"type":55,"tag":417,"props":2093,"children":2094},{"style":434},[2095],{"type":61,"value":466},{"type":55,"tag":417,"props":2097,"children":2098},{"style":469},[2099],{"type":61,"value":1612},{"type":55,"tag":417,"props":2101,"children":2102},{"style":434},[2103],{"type":61,"value":456},{"type":55,"tag":417,"props":2105,"children":2106},{"style":434},[2107],{"type":61,"value":2040},{"type":55,"tag":417,"props":2109,"children":2110},{"style":434},[2111],{"type":61,"value":466},{"type":55,"tag":417,"props":2113,"children":2114},{"style":1944},[2115],{"type":61,"value":2116},"value",{"type":55,"tag":417,"props":2118,"children":2119},{"style":434},[2120],{"type":61,"value":456},{"type":55,"tag":417,"props":2122,"children":2123},{"style":434},[2124],{"type":61,"value":461},{"type":55,"tag":417,"props":2126,"children":2127},{"style":434},[2128],{"type":61,"value":466},{"type":55,"tag":417,"props":2130,"children":2131},{"style":469},[2132],{"type":61,"value":2133},"499",{"type":55,"tag":417,"props":2135,"children":2136},{"style":434},[2137],{"type":61,"value":456},{"type":55,"tag":417,"props":2139,"children":2140},{"style":434},[2141],{"type":61,"value":486},{"type":55,"tag":417,"props":2143,"children":2144},{"class":419,"line":700},[2145],{"type":55,"tag":417,"props":2146,"children":2147},{"style":434},[2148],{"type":61,"value":2149},"    ]\n",{"type":55,"tag":417,"props":2151,"children":2152},{"class":419,"line":741},[2153],{"type":55,"tag":417,"props":2154,"children":2155},{"style":434},[2156],{"type":61,"value":2157},"  }\n",{"type":55,"tag":417,"props":2159,"children":2160},{"class":419,"line":749},[2161],{"type":55,"tag":417,"props":2162,"children":2163},{"style":434},[2164],{"type":61,"value":486},{"type":55,"tag":399,"props":2166,"children":2168},{"id":2167},"by-trace-id-when-known",[2169],{"type":61,"value":2170},"By trace ID (when known)",{"type":55,"tag":406,"props":2172,"children":2174},{"className":408,"code":2173,"language":410,"meta":411,"style":411},"posthog:apm-trace-get\n{\n  \"trace_id\": \"0123456789abcdef0123456789abcdef\"\n}\n",[2175],{"type":55,"tag":95,"props":2176,"children":2177},{"__ignoreMap":411},[2178,2185,2192,2224],{"type":55,"tag":417,"props":2179,"children":2180},{"class":419,"line":420},[2181],{"type":55,"tag":417,"props":2182,"children":2183},{"style":424},[2184],{"type":61,"value":427},{"type":55,"tag":417,"props":2186,"children":2187},{"class":419,"line":430},[2188],{"type":55,"tag":417,"props":2189,"children":2190},{"style":434},[2191],{"type":61,"value":437},{"type":55,"tag":417,"props":2193,"children":2194},{"class":419,"line":440},[2195,2199,2203,2207,2211,2215,2220],{"type":55,"tag":417,"props":2196,"children":2197},{"style":434},[2198],{"type":61,"value":446},{"type":55,"tag":417,"props":2200,"children":2201},{"style":449},[2202],{"type":61,"value":200},{"type":55,"tag":417,"props":2204,"children":2205},{"style":434},[2206],{"type":61,"value":456},{"type":55,"tag":417,"props":2208,"children":2209},{"style":434},[2210],{"type":61,"value":461},{"type":55,"tag":417,"props":2212,"children":2213},{"style":434},[2214],{"type":61,"value":466},{"type":55,"tag":417,"props":2216,"children":2217},{"style":469},[2218],{"type":61,"value":2219},"0123456789abcdef0123456789abcdef",{"type":55,"tag":417,"props":2221,"children":2222},{"style":434},[2223],{"type":61,"value":477},{"type":55,"tag":417,"props":2225,"children":2226},{"class":419,"line":480},[2227],{"type":55,"tag":417,"props":2228,"children":2229},{"style":434},[2230],{"type":61,"value":486},{"type":55,"tag":399,"props":2232,"children":2234},{"id":2233},"common-gotchas",[2235],{"type":61,"value":2236},"Common gotchas",{"type":55,"tag":506,"props":2238,"children":2239},{},[2240,2272,2318,2331],{"type":55,"tag":510,"props":2241,"children":2242},{},[2243,2248,2250,2256,2258,2263,2265,2270],{"type":55,"tag":73,"props":2244,"children":2245},{},[2246],{"type":61,"value":2247},"Durations are nanoseconds.",{"type":61,"value":2249}," 1 second = ",{"type":55,"tag":95,"props":2251,"children":2253},{"className":2252},[],[2254],{"type":61,"value":2255},"1_000_000_000",{"type":61,"value":2257},". Filter values in ",{"type":55,"tag":95,"props":2259,"children":2261},{"className":2260},[],[2262],{"type":61,"value":1404},{"type":61,"value":2264}," for ",{"type":55,"tag":95,"props":2266,"children":2268},{"className":2267},[],[2269],{"type":61,"value":1262},{"type":61,"value":2271}," are also nanoseconds.",{"type":55,"tag":510,"props":2273,"children":2274},{},[2275,2285,2287,2292,2294,2300,2302,2308,2310,2316],{"type":55,"tag":73,"props":2276,"children":2277},{},[2278,2283],{"type":55,"tag":95,"props":2279,"children":2281},{"className":2280},[],[2282],{"type":61,"value":1136},{"type":61,"value":2284}," is Error.",{"type":61,"value":2286}," ",{"type":55,"tag":95,"props":2288,"children":2290},{"className":2289},[],[2291],{"type":61,"value":847},{"type":61,"value":2293}," is Unset, ",{"type":55,"tag":95,"props":2295,"children":2297},{"className":2296},[],[2298],{"type":61,"value":2299},"1",{"type":61,"value":2301}," is OK. Use ",{"type":55,"tag":95,"props":2303,"children":2305},{"className":2304},[],[2306],{"type":61,"value":2307},"OK",{"type":61,"value":2309}," to match ",{"type":55,"tag":95,"props":2311,"children":2313},{"className":2312},[],[2314],{"type":61,"value":2315},"{0, 1}",{"type":61,"value":2317}," in the UI filter.",{"type":55,"tag":510,"props":2319,"children":2320},{},[2321,2329],{"type":55,"tag":73,"props":2322,"children":2323},{},[2324],{"type":55,"tag":95,"props":2325,"children":2327},{"className":2326},[],[2328],{"type":61,"value":381},{"type":61,"value":2330}," is an integer 0–5: 0 Unspecified, 1 Internal, 2 Server, 3 Client, 4 Producer, 5 Consumer.",{"type":55,"tag":510,"props":2332,"children":2333},{},[2334,2344,2346,2352,2354,2360],{"type":55,"tag":73,"props":2335,"children":2336},{},[2337,2342],{"type":55,"tag":95,"props":2338,"children":2340},{"className":2339},[],[2341],{"type":61,"value":546},{"type":61,"value":2343}," of a root span",{"type":61,"value":2345}," is ",{"type":55,"tag":95,"props":2347,"children":2349},{"className":2348},[],[2350],{"type":61,"value":2351},"\"0000000000000000\"",{"type":61,"value":2353}," (16 zero hex chars, matching the 8-byte span ID width — ",{"type":55,"tag":2355,"props":2356,"children":2357},"em",{},[2358],{"type":61,"value":2359},"not",{"type":61,"value":2361}," the 16-byte trace ID width), not null.",{"type":55,"tag":127,"props":2363,"children":2365},{"id":2364},"parsing-large-trace-results",[2366],{"type":61,"value":2367},"Parsing large trace results",{"type":55,"tag":64,"props":2369,"children":2370},{},[2371],{"type":61,"value":2372},"Trace tool results are JSON. When too large to read inline, Claude Code persists them to a file.",{"type":55,"tag":399,"props":2374,"children":2376},{"id":2375},"persisted-file-format",[2377],{"type":61,"value":2378},"Persisted file format",{"type":55,"tag":406,"props":2380,"children":2382},{"className":408,"code":2381,"language":410,"meta":411,"style":411},"[{ \"type\": \"text\", \"text\": \"{\\\"results\\\": [...], \\\"_posthogUrl\\\": \\\"...\\\"}\" }]\n",[2383],{"type":55,"tag":95,"props":2384,"children":2385},{"__ignoreMap":411},[2386],{"type":55,"tag":417,"props":2387,"children":2388},{"class":419,"line":420},[2389,2394,2398,2402,2406,2410,2414,2418,2422,2426,2430,2434,2438,2442,2446,2451,2456,2461,2465,2470,2474,2478,2482,2487,2491,2496,2500,2505,2509],{"type":55,"tag":417,"props":2390,"children":2391},{"style":434},[2392],{"type":61,"value":2393},"[{",{"type":55,"tag":417,"props":2395,"children":2396},{"style":434},[2397],{"type":61,"value":466},{"type":55,"tag":417,"props":2399,"children":2400},{"style":449},[2401],{"type":61,"value":2083},{"type":55,"tag":417,"props":2403,"children":2404},{"style":434},[2405],{"type":61,"value":456},{"type":55,"tag":417,"props":2407,"children":2408},{"style":434},[2409],{"type":61,"value":461},{"type":55,"tag":417,"props":2411,"children":2412},{"style":434},[2413],{"type":61,"value":466},{"type":55,"tag":417,"props":2415,"children":2416},{"style":469},[2417],{"type":61,"value":61},{"type":55,"tag":417,"props":2419,"children":2420},{"style":434},[2421],{"type":61,"value":456},{"type":55,"tag":417,"props":2423,"children":2424},{"style":434},[2425],{"type":61,"value":2040},{"type":55,"tag":417,"props":2427,"children":2428},{"style":434},[2429],{"type":61,"value":466},{"type":55,"tag":417,"props":2431,"children":2432},{"style":449},[2433],{"type":61,"value":61},{"type":55,"tag":417,"props":2435,"children":2436},{"style":434},[2437],{"type":61,"value":456},{"type":55,"tag":417,"props":2439,"children":2440},{"style":434},[2441],{"type":61,"value":461},{"type":55,"tag":417,"props":2443,"children":2444},{"style":434},[2445],{"type":61,"value":466},{"type":55,"tag":417,"props":2447,"children":2448},{"style":469},[2449],{"type":61,"value":2450},"{",{"type":55,"tag":417,"props":2452,"children":2453},{"style":424},[2454],{"type":61,"value":2455},"\\\"",{"type":55,"tag":417,"props":2457,"children":2458},{"style":469},[2459],{"type":61,"value":2460},"results",{"type":55,"tag":417,"props":2462,"children":2463},{"style":424},[2464],{"type":61,"value":2455},{"type":55,"tag":417,"props":2466,"children":2467},{"style":469},[2468],{"type":61,"value":2469},": [...], ",{"type":55,"tag":417,"props":2471,"children":2472},{"style":424},[2473],{"type":61,"value":2455},{"type":55,"tag":417,"props":2475,"children":2476},{"style":469},[2477],{"type":61,"value":571},{"type":55,"tag":417,"props":2479,"children":2480},{"style":424},[2481],{"type":61,"value":2455},{"type":55,"tag":417,"props":2483,"children":2484},{"style":469},[2485],{"type":61,"value":2486},": ",{"type":55,"tag":417,"props":2488,"children":2489},{"style":424},[2490],{"type":61,"value":2455},{"type":55,"tag":417,"props":2492,"children":2493},{"style":469},[2494],{"type":61,"value":2495},"...",{"type":55,"tag":417,"props":2497,"children":2498},{"style":424},[2499],{"type":61,"value":2455},{"type":55,"tag":417,"props":2501,"children":2502},{"style":469},[2503],{"type":61,"value":2504},"}",{"type":55,"tag":417,"props":2506,"children":2507},{"style":434},[2508],{"type":61,"value":456},{"type":55,"tag":417,"props":2510,"children":2511},{"style":434},[2512],{"type":61,"value":2513}," }]\n",{"type":55,"tag":64,"props":2515,"children":2516},{},[2517,2519,2525],{"type":61,"value":2518},"Every script in ",{"type":55,"tag":95,"props":2520,"children":2522},{"className":2521},[],[2523],{"type":61,"value":2524},"scripts\u002F",{"type":61,"value":2526}," unwraps this envelope before parsing.",{"type":55,"tag":399,"props":2528,"children":2530},{"id":2529},"trace-json-structure",[2531],{"type":61,"value":2532},"Trace JSON structure",{"type":55,"tag":406,"props":2534,"children":2538},{"className":2535,"code":2537,"language":61,"meta":411},[2536],"language-text","results (array of span dicts)\n  └── each span:\n        ├── uuid, trace_id, span_id, parent_span_id (hex strings)\n        ├── name, kind (int 0–5), service_name\n        ├── status_code (int 0–2), is_root_span (bool)\n        ├── timestamp, end_time (ISO 8601)\n        ├── duration_nano (int, nanoseconds)\n        ├── attributes (map of span-level OTel attributes, e.g. db.statement, http.url)\n        └── matched_filter (0\u002F1 — 1 if this span matched the query-apm-spans filter, 0 if it\n            only shares a trace with a match; always present, only meaningful from query-apm-spans)\n",[2539],{"type":55,"tag":95,"props":2540,"children":2541},{"__ignoreMap":411},[2542],{"type":61,"value":2537},{"type":55,"tag":399,"props":2544,"children":2546},{"id":2545},"available-scripts",[2547],{"type":61,"value":2548},"Available scripts",{"type":55,"tag":134,"props":2550,"children":2551},{},[2552,2572],{"type":55,"tag":138,"props":2553,"children":2554},{},[2555],{"type":55,"tag":142,"props":2556,"children":2557},{},[2558,2563,2567],{"type":55,"tag":146,"props":2559,"children":2560},{},[2561],{"type":61,"value":2562},"Script",{"type":55,"tag":146,"props":2564,"children":2565},{},[2566],{"type":61,"value":155},{"type":55,"tag":146,"props":2568,"children":2569},{},[2570],{"type":61,"value":2571},"Usage",{"type":55,"tag":157,"props":2573,"children":2574},{},[2575,2604,2640,2670,2700],{"type":55,"tag":142,"props":2576,"children":2577},{},[2578,2590,2595],{"type":55,"tag":164,"props":2579,"children":2580},{},[2581],{"type":55,"tag":368,"props":2582,"children":2584},{"href":2583},".\u002Fscripts\u002Fprint_summary.py",[2585],{"type":55,"tag":95,"props":2586,"children":2588},{"className":2587},[],[2589],{"type":61,"value":1057},{"type":55,"tag":164,"props":2591,"children":2592},{},[2593],{"type":61,"value":2594},"Trace metadata, services, slowest spans, errors",{"type":55,"tag":164,"props":2596,"children":2597},{},[2598],{"type":55,"tag":95,"props":2599,"children":2601},{"className":2600},[],[2602],{"type":61,"value":2603},"python3 scripts\u002Fprint_summary.py FILE",{"type":55,"tag":142,"props":2605,"children":2606},{},[2607,2619,2631],{"type":55,"tag":164,"props":2608,"children":2609},{},[2610],{"type":55,"tag":368,"props":2611,"children":2613},{"href":2612},".\u002Fscripts\u002Fprint_timeline.py",[2614],{"type":55,"tag":95,"props":2615,"children":2617},{"className":2616},[],[2618],{"type":61,"value":1076},{"type":55,"tag":164,"props":2620,"children":2621},{},[2622,2624,2629],{"type":61,"value":2623},"DFS-indented tree from ",{"type":55,"tag":95,"props":2625,"children":2627},{"className":2626},[],[2628],{"type":61,"value":546},{"type":61,"value":2630}," walk",{"type":55,"tag":164,"props":2632,"children":2633},{},[2634],{"type":55,"tag":95,"props":2635,"children":2637},{"className":2636},[],[2638],{"type":61,"value":2639},"python3 scripts\u002Fprint_timeline.py FILE",{"type":55,"tag":142,"props":2641,"children":2642},{},[2643,2656,2661],{"type":55,"tag":164,"props":2644,"children":2645},{},[2646],{"type":55,"tag":368,"props":2647,"children":2649},{"href":2648},".\u002Fscripts\u002Fextract_span.py",[2650],{"type":55,"tag":95,"props":2651,"children":2653},{"className":2652},[],[2654],{"type":61,"value":2655},"extract_span.py",{"type":55,"tag":164,"props":2657,"children":2658},{},[2659],{"type":61,"value":2660},"Full row + parent\u002Fchildren for spans matching a name",{"type":55,"tag":164,"props":2662,"children":2663},{},[2664],{"type":55,"tag":95,"props":2665,"children":2667},{"className":2666},[],[2668],{"type":61,"value":2669},"SPAN=\"name\" python3 scripts\u002Fextract_span.py FILE",{"type":55,"tag":142,"props":2671,"children":2672},{},[2673,2686,2691],{"type":55,"tag":164,"props":2674,"children":2675},{},[2676],{"type":55,"tag":368,"props":2677,"children":2679},{"href":2678},".\u002Fscripts\u002Fsearch_spans.py",[2680],{"type":55,"tag":95,"props":2681,"children":2683},{"className":2682},[],[2684],{"type":61,"value":2685},"search_spans.py",{"type":55,"tag":164,"props":2687,"children":2688},{},[2689],{"type":61,"value":2690},"Find a keyword across name, service_name, IDs",{"type":55,"tag":164,"props":2692,"children":2693},{},[2694],{"type":55,"tag":95,"props":2695,"children":2697},{"className":2696},[],[2698],{"type":61,"value":2699},"SEARCH=\"kw\" python3 scripts\u002Fsearch_spans.py FILE",{"type":55,"tag":142,"props":2701,"children":2702},{},[2703,2716,2721],{"type":55,"tag":164,"props":2704,"children":2705},{},[2706],{"type":55,"tag":368,"props":2707,"children":2709},{"href":2708},".\u002Fscripts\u002Fshow_structure.py",[2710],{"type":55,"tag":95,"props":2711,"children":2713},{"className":2712},[],[2714],{"type":61,"value":2715},"show_structure.py",{"type":55,"tag":164,"props":2717,"children":2718},{},[2719],{"type":61,"value":2720},"Show JSON keys and types without values",{"type":55,"tag":164,"props":2722,"children":2723},{},[2724],{"type":55,"tag":95,"props":2725,"children":2727},{"className":2726},[],[2728],{"type":61,"value":2729},"python3 scripts\u002Fshow_structure.py FILE",{"type":55,"tag":127,"props":2731,"children":2733},{"id":2732},"tips",[2734],{"type":61,"value":2735},"Tips",{"type":55,"tag":506,"props":2737,"children":2738},{},[2739,2765,2784,2838,2855],{"type":55,"tag":510,"props":2740,"children":2741},{},[2742,2744,2749,2751,2756,2758,2763],{"type":61,"value":2743},"Always set ",{"type":55,"tag":95,"props":2745,"children":2747},{"className":2746},[],[2748],{"type":61,"value":1396},{"type":61,"value":2750}," on ",{"type":55,"tag":95,"props":2752,"children":2754},{"className":2753},[],[2755],{"type":61,"value":1404},{"type":61,"value":2757}," — queries without a time range are slow. Default is ",{"type":55,"tag":95,"props":2759,"children":2761},{"className":2760},[],[2762],{"type":61,"value":1964},{"type":61,"value":2764},"; widen only when needed.",{"type":55,"tag":510,"props":2766,"children":2767},{},[2768,2770,2775,2777,2782],{"type":61,"value":2769},"Always include the ",{"type":55,"tag":95,"props":2771,"children":2773},{"className":2772},[],[2774],{"type":61,"value":571},{"type":61,"value":2776}," from ",{"type":55,"tag":95,"props":2778,"children":2780},{"className":2779},[],[2781],{"type":61,"value":1022},{"type":61,"value":2783}," in your response so the user can click through to the trace.",{"type":55,"tag":510,"props":2785,"children":2786},{},[2787,2789,2794,2796,2801,2802,2807,2809,2814,2816,2821,2823,2829,2831,2836],{"type":61,"value":2788},"Span-level attributes ",{"type":55,"tag":73,"props":2790,"children":2791},{},[2792],{"type":61,"value":2793},"are",{"type":61,"value":2795}," in the ",{"type":55,"tag":95,"props":2797,"children":2799},{"className":2798},[],[2800],{"type":61,"value":1022},{"type":61,"value":1307},{"type":55,"tag":95,"props":2803,"children":2805},{"className":2804},[],[2806],{"type":61,"value":1404},{"type":61,"value":2808}," payload (each span's ",{"type":55,"tag":95,"props":2810,"children":2812},{"className":2811},[],[2813],{"type":61,"value":1161},{"type":61,"value":2815}," map). Resource attributes are not — use ",{"type":55,"tag":95,"props":2817,"children":2819},{"className":2818},[],[2820],{"type":61,"value":1275},{"type":61,"value":2822}," (type ",{"type":55,"tag":95,"props":2824,"children":2826},{"className":2825},[],[2827],{"type":61,"value":2828},"resource",{"type":61,"value":2830},") and ",{"type":55,"tag":95,"props":2832,"children":2834},{"className":2833},[],[2835],{"type":61,"value":1191},{"type":61,"value":2837}," for those.",{"type":55,"tag":510,"props":2839,"children":2840},{},[2841,2846,2848,2854],{"type":55,"tag":95,"props":2842,"children":2844},{"className":2843},[],[2845],{"type":61,"value":560},{"type":61,"value":2847}," is the cheap way to find the trace entry — don't string-match ",{"type":55,"tag":95,"props":2849,"children":2851},{"className":2850},[],[2852],{"type":61,"value":2853},"00000000…",{"type":61,"value":955},{"type":55,"tag":510,"props":2856,"children":2857},{},[2858,2860,2866,2868,2873],{"type":61,"value":2859},"For aggregates (p95 by operation, slowest children of a span), use ",{"type":55,"tag":95,"props":2861,"children":2863},{"className":2862},[],[2864],{"type":61,"value":2865},"apm-spans-aggregate",{"type":61,"value":2867}," for a flat view or ",{"type":55,"tag":95,"props":2869,"children":2871},{"className":2870},[],[2872],{"type":61,"value":1101},{"type":61,"value":2874}," for parent→child edges — don't reach for SQL.",{"type":55,"tag":2876,"props":2877,"children":2878},"style",{},[2879],{"type":61,"value":2880},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2882,"total":3047},[2883,2897,2909,2921,2932,2947,2963,2980,2994,3009,3019,3037],{"slug":2884,"name":2884,"fn":2885,"description":2886,"org":2887,"tags":2888,"stars":23,"repoUrl":24,"updatedAt":2896},"analyzing-expensive-users","analyze expensive users in AI observability","Analyze the most expensive users in AI observability and explain why they cost so much. Use when the user asks about top spenders, expensive users, per-user LLM cost, user-level cost drivers, or patterns behind high AI observability spend.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2889,2891,2894,2895],{"name":2890,"slug":31,"type":15},"Analytics",{"name":2892,"slug":2893,"type":15},"Cost Optimization","cost-optimization",{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},"2026-07-28T05:34:11.117757",{"slug":2898,"name":2898,"fn":2899,"description":2900,"org":2901,"tags":2902,"stars":23,"repoUrl":24,"updatedAt":2908},"auditing-endpoints","audit PostHog project endpoints","Audit every endpoint in a PostHog project for staleness, failed materialisations, and unused materialised versions. Use when the user asks \"what endpoints can I clean up?\", \"are any of my endpoints broken?\", \"which materialised versions are still being called?\", or wants a one-shot cleanup pass over the Endpoints product. Produces a prioritised report grouped by issue type, with recommended actions but does not modify anything without explicit confirmation.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2903,2904,2907],{"name":2890,"slug":31,"type":15},{"name":2905,"slug":2906,"type":15},"Audit","audit",{"name":9,"slug":8,"type":15},"2026-06-08T08:08:33.693989",{"slug":2910,"name":2910,"fn":2911,"description":2912,"org":2913,"tags":2914,"stars":23,"repoUrl":24,"updatedAt":2920},"auditing-warehouse-source-health","audit PostHog data warehouse source health","Audit the health of a PostHog project's data warehouse sources and syncs — find every broken or degraded source connection, sync schema, and webhook channel. Use when the user asks \"why are my imports failing?\", \"what's broken with my sources?\", \"why is my warehouse data stale?\", or wants a one-shot triage of source\u002Fsync health before deciding where to dig in. Produces a prioritized report grouped by severity, with recommended next steps. For materialized-view health use `auditing-warehouse-view-health`; for a single failing sync use `diagnosing-failed-warehouse-syncs`.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2915,2916,2918,2919],{"name":2905,"slug":2906,"type":15},{"name":2917,"slug":33,"type":15},"Data Warehouse",{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},"2026-06-18T08:22:57.67984",{"slug":2922,"name":2922,"fn":2923,"description":2924,"org":2925,"tags":2926,"stars":23,"repoUrl":24,"updatedAt":2931},"auditing-warehouse-view-health","audit PostHog materialized view health","Audit the health of a PostHog project's materialized views (saved queries) — find every failed materialization and flag unused or stale materialized views that cost storage and compute. Use when the user asks \"which of my views are broken?\", \"why is this materialized view failing?\", \"are any of my views wasting compute?\", or wants a one-shot triage of view health. For source\u002Fsync health use `auditing-warehouse-source-health`.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2927,2928,2929,2930],{"name":2905,"slug":2906,"type":15},{"name":2917,"slug":33,"type":15},{"name":20,"slug":21,"type":15},{"name":9,"slug":8,"type":15},"2026-06-18T08:25:10.936787",{"slug":2933,"name":2933,"fn":2934,"description":2935,"org":2936,"tags":2937,"stars":23,"repoUrl":24,"updatedAt":2946},"authoring-error-tracking-alerts","author PostHog error tracking alerts","Author error tracking alerts that fire when an issue is created, reopened, or starts spiking. Use when the user asks to set up error notifications, route exceptions to Slack\u002Fwebhook\u002FLinear, or evaluate which error events are worth alerting on. Covers trigger-event selection, integration choice, dedup against existing alerts, and shipping with the canonical message body shape.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2938,2941,2944,2945],{"name":2939,"slug":2940,"type":15},"Alerting","alerting",{"name":2942,"slug":2943,"type":15},"Debugging","debugging",{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},"2026-06-18T08:24:40.318583",{"slug":2948,"name":2948,"fn":2949,"description":2950,"org":2951,"tags":2952,"stars":23,"repoUrl":24,"updatedAt":2962},"authoring-log-alerts","author log alerts in PostHog","Author useful, low-noise log alerts on services in a PostHog project. Use when the user asks to set up alerts for their logs, suggest alerts they should add, or evaluate whether a service is worth monitoring. Covers service triage, baseline characterisation, threshold drafting, back-testing via simulate, and shipping with a notification destination.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2953,2954,2957,2958,2961],{"name":2890,"slug":31,"type":15},{"name":2955,"slug":2956,"type":15},"Monitoring","monitoring",{"name":17,"slug":18,"type":15},{"name":2959,"slug":2960,"type":15},"Operations","operations",{"name":9,"slug":8,"type":15},"2026-07-18T05:10:54.430898",{"slug":2964,"name":2964,"fn":2965,"description":2966,"org":2967,"tags":2968,"stars":23,"repoUrl":24,"updatedAt":2979},"building-workflows","build and edit PostHog workflows","Build, edit, test, enable, and monitor PostHog workflows over MCP. Author the action\u002Fedge graph so it runs and opens cleanly in the visual editor, then change drafts surgically with patch operations. Use when asked to build, set up, automate, change, fix, or debug a workflow, campaign, broadcast, drip sequence, or event-triggered automation in the workflows product.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2969,2972,2975,2976],{"name":2970,"slug":2971,"type":15},"Automation","automation",{"name":2973,"slug":2974,"type":15},"MCP","mcp",{"name":9,"slug":8,"type":15},{"name":2977,"slug":2978,"type":15},"Workflow Automation","workflow-automation","2026-07-28T05:34:12.167015",{"slug":2981,"name":2981,"fn":2982,"description":2983,"org":2984,"tags":2985,"stars":23,"repoUrl":24,"updatedAt":2993},"check-posthog-loading","inspect PostHog SDK loading across URLs","Inspect how the PostHog JavaScript SDK is loaded across a list of URLs. Use to confirm consistent installation across pages, find pages missing the snippet, detect mismatched API keys or hosts between pages, and verify the load method (head snippet vs deferred vs array.js).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2986,2987,2988,2991,2992],{"name":2890,"slug":31,"type":15},{"name":2942,"slug":2943,"type":15},{"name":2989,"slug":2990,"type":15},"Frontend","frontend",{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},"2026-05-07T05:56:19.828048",{"slug":2995,"name":2995,"fn":2996,"description":2997,"org":2998,"tags":2999,"stars":23,"repoUrl":24,"updatedAt":3008},"consuming-endpoints-from-client-code","integrate PostHog endpoints into client applications","Wire a PostHog endpoint into a client app or SDK. Covers fetching the OpenAPI spec, generating a typed client with openapi-generator or @hey-api\u002Fopenapi-ts, sending the right auth header, shaping the variables payload (HogQL code_name vs insight breakdown property), handling rate-limit and materialised-endpoint error responses. Use when the user says \"how do I call my endpoint\", \"generate a client for this\", or \"what auth header do I use\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3000,3003,3004,3005],{"name":3001,"slug":3002,"type":15},"API Development","api-development",{"name":2989,"slug":2990,"type":15},{"name":9,"slug":8,"type":15},{"name":3006,"slug":3007,"type":15},"SDK","sdk","2026-06-08T08:08:34.929454",{"slug":3010,"name":3010,"fn":3011,"description":3012,"org":3013,"tags":3014,"stars":23,"repoUrl":24,"updatedAt":3018},"copying-endpoints-across-projects","copy PostHog endpoints across projects","Copy a PostHog endpoint (a saved HogQL\u002Finsight query exposed as an API route) to another project in the same organization, or duplicate it under a new name in the same project. Use when the user wants to duplicate an endpoint, promote an endpoint from staging to production, replicate an endpoint's query\u002Fvariables\u002Ffreshness config in another workspace, or clone an endpoint to iterate on it. Unlike feature flags and experiments, endpoints have NO native cross-project copy tool — this skill covers the read-then-recreate flow (endpoint-get then endpoint-create), the active-project switching it requires, name-collision checks, and the safe defaults (land unmaterialised in the target, verify with endpoint-run). Does not cover editing endpoint versions (see managing-endpoint-versions) or authoring a brand-new endpoint from scratch (see creating-an-endpoint).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3015,3016,3017],{"name":3001,"slug":3002,"type":15},{"name":2959,"slug":2960,"type":15},{"name":9,"slug":8,"type":15},"2026-07-15T05:29:58.442727",{"slug":3020,"name":3020,"fn":3021,"description":3022,"org":3023,"tags":3024,"stars":23,"repoUrl":24,"updatedAt":3036},"creating-ai-subscription","schedule recurring AI-generated PostHog reports","Create a recurring AI-generated PostHog report — schedule a free-text prompt to run on a cron, with the LLM-synthesized markdown delivered to email or Slack on each tick. Use when the user wants a recurring AI summary of X on any cadence (daily, weekly, monthly, yearly) rather than a one-off report. (To attach an AI summary to an existing insight\u002Fdashboard subscription instead of a free-text prompt, see `managing-subscriptions` and its `summary_enabled` option.)\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3025,3026,3029,3030,3033],{"name":2970,"slug":2971,"type":15},{"name":3027,"slug":3028,"type":15},"Email","email",{"name":9,"slug":8,"type":15},{"name":3031,"slug":3032,"type":15},"Reporting","reporting",{"name":3034,"slug":3035,"type":15},"Slack","slack","2026-06-09T07:32:27.935712",{"slug":3038,"name":3038,"fn":3039,"description":3040,"org":3041,"tags":3042,"stars":23,"repoUrl":24,"updatedAt":3046},"creating-an-endpoint","create PostHog API endpoints","Create a PostHog endpoint with the right shape on the first try — covers query kind choice, name conventions, what to expose as variables (HogQL code_name vs insight breakdown), data_freshness_seconds, and whether to materialise on day one. Use when the user says \"create an endpoint\", \"expose this query as an API\", \"turn this insight into an endpoint\", or asks for help structuring a new endpoint. Steers away from common mistakes: materialising a query with cohort breakdowns or compare mode, inline-only variables on a materialised endpoint, unbounded date ranges, ambiguous names.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3043,3044,3045],{"name":2890,"slug":31,"type":15},{"name":3001,"slug":3002,"type":15},{"name":9,"slug":8,"type":15},"2026-06-08T08:08:29.624498",231,{"items":3049,"total":3099},[3050,3057,3063,3070,3077,3084,3092],{"slug":2884,"name":2884,"fn":2885,"description":2886,"org":3051,"tags":3052,"stars":23,"repoUrl":24,"updatedAt":2896},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3053,3054,3055,3056],{"name":2890,"slug":31,"type":15},{"name":2892,"slug":2893,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"slug":2898,"name":2898,"fn":2899,"description":2900,"org":3058,"tags":3059,"stars":23,"repoUrl":24,"updatedAt":2908},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3060,3061,3062],{"name":2890,"slug":31,"type":15},{"name":2905,"slug":2906,"type":15},{"name":9,"slug":8,"type":15},{"slug":2910,"name":2910,"fn":2911,"description":2912,"org":3064,"tags":3065,"stars":23,"repoUrl":24,"updatedAt":2920},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3066,3067,3068,3069],{"name":2905,"slug":2906,"type":15},{"name":2917,"slug":33,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"slug":2922,"name":2922,"fn":2923,"description":2924,"org":3071,"tags":3072,"stars":23,"repoUrl":24,"updatedAt":2931},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3073,3074,3075,3076],{"name":2905,"slug":2906,"type":15},{"name":2917,"slug":33,"type":15},{"name":20,"slug":21,"type":15},{"name":9,"slug":8,"type":15},{"slug":2933,"name":2933,"fn":2934,"description":2935,"org":3078,"tags":3079,"stars":23,"repoUrl":24,"updatedAt":2946},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3080,3081,3082,3083],{"name":2939,"slug":2940,"type":15},{"name":2942,"slug":2943,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"slug":2948,"name":2948,"fn":2949,"description":2950,"org":3085,"tags":3086,"stars":23,"repoUrl":24,"updatedAt":2962},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3087,3088,3089,3090,3091],{"name":2890,"slug":31,"type":15},{"name":2955,"slug":2956,"type":15},{"name":17,"slug":18,"type":15},{"name":2959,"slug":2960,"type":15},{"name":9,"slug":8,"type":15},{"slug":2964,"name":2964,"fn":2965,"description":2966,"org":3093,"tags":3094,"stars":23,"repoUrl":24,"updatedAt":2979},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3095,3096,3097,3098],{"name":2970,"slug":2971,"type":15},{"name":2973,"slug":2974,"type":15},{"name":9,"slug":8,"type":15},{"name":2977,"slug":2978,"type":15},61]