Zum Inhalt springen
Skillpedia
Deployment & Cloud (DevOps)41k · #6871

linking-errors-to-traces

Was er macht

Dieser Skill verknüpft einen Fehler mit dem Backend-Trace, den Logs und der Sitzungsaufzeichnung, die dieselbe ID teilen. Er richtet sich an Entwickler, die ein Problem vom Frontend bis in den Server verfolgen wollen.

Wann du ihn nutzt

  • ✓Wenn du die Trace- oder Span-ID für ein bestimmtes Fehlervorkommen willst.
  • ✓Wenn du die Backend-Logs brauchst, die eine Trace-ID mit einem Fehler teilen.
  • ✓Wenn du für die Fehler einer Sitzung die Sitzungsaufzeichnung und die Backend-Traces zusammen sehen willst.

Link zum Skill

https://github.com/PostHog/posthog/blob/master/products/error_tracking/skills/linking-errors-to-traces/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/PostHog/posthog/blob/master/products/error_tracking/skills/linking-errors-to-traces/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Finde den Backend-Trace und die Logs zu diesem Fehlervorkommen, damit ich sehe, was der Server getan hat.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Skill startet bei einem Fehler oder einer Sitzungs-ID, folgt der gemeinsamen Trace-ID zu den passenden Spans und Logs und prüft die Sitzungsaufzeichnung. Er verknüpft nur Datensätze, die eine ID teilen, nicht solche, die nur ungefähr zur gleichen Zeit passieren.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Link errors to traces and logs

Use a shared ID to connect records. A matching service and time do not prove that a log or span belongs to an error.

Find the exception

For an issue ID or URL, call posthog:query-error-tracking-issue-events with include: ["exception", "correlation"], filterTestAccounts: false, and a small limit. Choose one occurrence unless the user asks for several. Say when the result is a sample.

For an occurrence ID or session ID, read finding-exceptions.md for the exact lookup. Use the user's time range when given. If no event appears, state the window you checked. Do not claim that an event never existed based on a bounded search.

Follow the IDs

  1. Replay: If the event has $session_id, call posthog:session-recording-get with that ID. found: false means no recording was found; the error or session may still exist. Use posthog:generate-app-url with /replay/{id} when a recording exists.
  2. Exact trace: For each unique, nonzero, 32-character hex $trace_id, call posthog:apm-trace-get with that ID and excludeAttributes: true. Use its _posthogUrl for the trace link. If the event has $span_id, compare it with returned span IDs as hex, ignoring case. An empty result means no retained span was found for that trace ID. Logs may still exist.
  3. Session trace candidates: If an event lacks $trace_id and the user asked about session traces, use posthog:apm-attributes-list to find a span attribute that stores the session ID. If a clear key exists, call posthog:query-apm-spans with an exact span_attribute filter, a short window around the error, flatSpans: true, and a small limit. This finds matching child spans as well as root spans. Call posthog:apm-trace-get for a candidate that needs a link. Label these as session matches. Time alone does not prove which request raised the error.
  4. Same-trace logs: When an event has a trace ID, read finding-trace-logs.md for the bounded service lookup and exact log filter. Include every severity, including info. A trace can have logs even when no span was retained.

Use posthog:generate-app-url with /error-tracking/{id} when the issue ID is known. Do not build PostHog links by hand.

Report the result

For each checked occurrence, show the error time, IDs used for the join, and links to the issue, replay, and retained trace when available. Summarize matching logs with their time and severity. Exclude secrets and unneeded personal data from log excerpts.

Name each gap separately: no trace ID on the event, trace ID but no retained span, no session attribute on spans, no recording, or no logs with that trace ID in the checked window. A session-matched span is a candidate until an exact trace or span ID connects it to the error. State any row limit or time range that kept the search from being complete. If a lookup fails, say that its result is unknown instead of reporting that no matching data exists.

Häufige Fragen

Warum braucht er eine gemeinsame ID?

Ein Abgleich nur nach Dienst und Zeit kann die falschen Datensätze verknüpfen, deshalb verlangt der Skill eine gemeinsame Trace-ID.

Was ist, wenn kein Trace gefunden wird?

Der Skill nennt das durchsuchte Zeitfenster. Logs können trotzdem existieren, auch wenn kein Span gefunden wird.

Kann er eine allgemeine Diagnose stellen?

Nein. Für eine allgemeine Diagnose oder eine Zusammenfassung der Aufzeichnung gibt es andere Skills zur Fehleruntersuchung.

Details

Originalbeschreibung des Autors

Links a PostHog error occurrence or session's errors to OpenTelemetry traces, logs with the same trace ID, and Session Replay. Use when the user asks for trace or span IDs on an error, same-trace logs, or backend traces for errors in a session. Starts from an occurrence UUID, session ID, or error tracking issue URL. For a general issue diagnosis or replay summary, use investigating-error-issue or investigating-replay.

repo: PostHog/posthog

Beliebtheit

GitHub-Sterne
41k
Platz im Ranking
#6871
Lizenz
—
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills