Skip to content
getsentry avatar

Sentry Instrumentation Guide

Decision framework for choosing between Sentry errors, spans, span attributes, logs, and metrics when instrumenting code.

CCM score
75 of 100
skills.sh installs
1.3K
GitHub stars
283
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the four signals (errors, traces, logs, metrics), each mapped to the single question it answers
  • Includes a gut-check decision table, four tiebreakers for overlapping cases, and a retention comparison for sampling versus filtering
  • Enforces that logs and metrics are filtered rather than sampled, so rare failing requests are not lost
  • Designed for developers and coding agents deciding what to emit; hands SDK setup off to the matching sentry-*-sdk skills

Install

$ npx -y skills add getsentry/sentry-for-ai --skill sentry-instrumentation-guide -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

All Skills > Feature Setup > Instrumentation Guide

Sentry Instrumentation Guide: When to Reach for What

Errors, traces, logs, and metrics are the four kinds of telemetry most apps run on, and they overlap enough that the choice is rarely obvious. You can stuff context into a span attribute instead of logging it. You can count log lines instead of emitting a metric. You can add a duration to a log and call it a span.

But each signal exists because it answers a different question and feeds a different workflow once it lands. Reaching for the wrong one means the data is technically there but useless for the job you actually have later. This skill is the decision framework: given a value or an event in front of you, which signal should carry it, and why.

It decides what to emit. For how to turn each pillar on for a given stack, hand off to the sentry-*-sdk skills and sentry-setup-ai-monitoring.

Invoke This Skill When

Details

Repository
github.com/getsentry/sentry-for-ai
Categories
Debugging, Technical Documentation, DevOps & Cloud
First seen
Jul 14, 2026

Questions

What is the sentry-instrumentation-guide skill for?

It is a decision framework that tells you which Sentry signal to use when instrumenting code: an error, a span, a span attribute, a log, or a metric. It decides what to emit, while the sentry SDK skills handle how to set each signal up.

Should I use a log, a span, or a metric for something in my code?

Use a log for the state at one decision point, a span for where time went in a request, and a metric for trends across all requests. The guide's tiebreakers cover the common overlaps between these signals.

How do I install the sentry-instrumentation-guide skill?

Run npx -y skills add getsentry/sentry-for-ai --skill sentry-instrumentation-guide -y in your project. The skill then lets your agent decide which Sentry signal to reach for when adding or reviewing instrumentation.

Where does this skill stand in the Debugging category?

It is listed in the Debugging category alongside diagnosing-bugs, azure-messaging, safe-debug, systematic-debugging, and sentry-cli. It focuses on choosing what telemetry to emit rather than on tracing a live bug.

Does this skill sample or filter logs and metrics?

Traces are sampled, errors are captured by default, and logs and metrics are not sampled but are filtered with before_send_log and before_send_metric. The skill explains this retention difference as part of choosing signals.

More from getsentry/sentry-for-ai

All 27

Similar to Sentry Instrumentation Guide

More Debugging