본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)41k · #6871

linking-errors-to-traces

하는 일

이 스킬은 오류를 같은 ID를 공유하는 백엔드 트레이스, 로그, 세션 기록에 연결합니다. 프론트엔드에서 서버까지 문제를 따라가고 싶은 개발자를 위한 것입니다.

사용하는 경우

  • ✓특정 오류 발생의 트레이스나 스팬 ID가 필요할 때.
  • ✓오류와 트레이스 ID를 공유하는 백엔드 로그가 필요할 때.
  • ✓한 세션의 오류들에 대한 세션 리플레이와 백엔드 트레이스를 보고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/PostHog/posthog/blob/master/products/error_tracking/skills/linking-errors-to-traces/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 오류 발생과 연결된 백엔드 트레이스와 로그를 찾아서, 서버가 무엇을 했는지 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

오류나 세션 ID에서 시작해, 공유된 트레이스 ID를 따라 일치하는 스팬과 로그를 찾고, 세션 리플레이를 확인합니다. 비슷한 시간에 일어났다는 이유로 연결하지 않고, 같은 ID를 공유하는 기록만 연결합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.

자주 묻는 질문

공유된 ID가 왜 필요한가요?

서비스와 시간만으로 맞추면 잘못된 기록이 연결될 수 있으므로, 스킬은 공유된 트레이스 ID를 요구합니다.

트레이스를 찾지 못하면 어떻게 되나요?

스킬은 검색한 시간 창을 보고합니다. 스팬은 없어도 로그는 존재할 수 있습니다.

일반적인 진단을 해 주나요?

아니요. 일반 진단이나 리플레이 요약은 다른 오류 조사 스킬을 씁니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
41k
순위
#6871
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬