home / skills / jeremylongshore / claude-code-plugins-plus-skills / sentry-observability

This skill helps you integrate Sentry with your observability stack, enabling unified logging, metrics, and tracing across tools.

npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill sentry-observability

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
1.8 KB
---
name: sentry-observability
description: |
  Execute integrate Sentry with observability stack.
  Use when connecting Sentry to logging, metrics, APM tools,
  or building unified observability dashboards.
  Trigger with phrases like "sentry observability", "sentry logging integration",
  "sentry metrics", "sentry datadog integration".
allowed-tools: Read, Write, Edit, Grep
version: 1.0.0
license: MIT
author: Jeremy Longshore <[email protected]>
---

# Sentry Observability

## Prerequisites

- Existing observability stack (logging, metrics, APM)
- Trace ID correlation strategy
- Dashboard platform (Grafana, Datadog, etc.)
- Alert routing defined

## Instructions

1. Integrate logging library to send errors to Sentry as breadcrumbs
2. Add request ID tags for log correlation in Sentry scope
3. Track custom metrics using Sentry setMeasurement in transactions
4. Correlate with Prometheus by adding sentry_event_id label
5. Add APM trace IDs to Sentry events in beforeSend hook
6. Enable OpenTelemetry integration for automatic trace correlation
7. Create Grafana dashboard panels using Sentry API data
8. Configure PagerDuty integration for alert escalation
9. Add context links (logs, APM) to Slack alert templates
10. Establish consistent trace ID tagging across all observability tools

## Output
- Sentry integrated with logging system
- Metrics correlated with error events
- Distributed traces connected across tools
- Unified observability dashboard

## Error Handling

See `{baseDir}/references/errors.md` for comprehensive error handling.

## Examples

See `{baseDir}/references/examples.md` for detailed examples.

## Resources
- [Sentry Integrations](https://docs.sentry.io/product/integrations/)
- [OpenTelemetry Integration](https://docs.sentry.io/platforms/javascript/performance/instrumentation/opentelemetry/)

Overview

This skill integrates Sentry into an existing observability stack to connect errors, logs, metrics, and traces. It focuses on trace ID correlation, automatic OpenTelemetry linkage, and creating unified dashboards and alert routing. Use it to centralize error context and make incident triage faster.

How this skill works

The skill configures logging libraries to send breadcrumbs and adds request IDs and Sentry event IDs to logs and metrics for cross-tool correlation. It wires Sentry transactions and custom measurements into your metrics system and injects APM trace IDs into Sentry events via beforeSend hooks and OpenTelemetry integration. Finally, it automates dashboard panel creation and alert integrations (PagerDuty, Slack) so incidents include links to logs, traces, and Sentry events.

When to use it

  • You need end-to-end correlation between errors, logs, metrics, and traces.
  • Building unified observability dashboards in Grafana or Datadog.
  • Implementing trace ID propagation across services and tools.
  • Adding Sentry context to alerts and on-call routing.
  • Instrumenting custom metrics tied to error events.

Best practices

  • Establish a consistent trace ID and request ID tagging convention across services.
  • Send structured logs with a sentry_event_id label for Prometheus/metrics correlation.
  • Use Sentry setMeasurement on transactions for custom metrics you want visible in traces.
  • Enable and validate OpenTelemetry integration for automatic trace linking.
  • Populate Sentry scope with request IDs and key tags before sending events.

Example use cases

  • Add Sentry breadcrumbs from your logging library to show recent log lines on error events.
  • Tag logs with request_id and sentry_event_id so Grafana dashboards can join logs, metrics, and Sentry events.
  • Expose Sentry event IDs as Prometheus labels and surface them in alert annotations.
  • Attach APM trace IDs to Sentry events via a beforeSend hook to navigate from an error to the full trace.
  • Create Grafana panels that call the Sentry API to show error trends alongside metrics and latency.

FAQ

Which observability tools are supported?

This approach works with common stacks: Grafana, Datadog, Prometheus, OpenTelemetry, and common APMs that expose trace IDs.

How do I correlate metrics and Sentry events?

Add a sentry_event_id label to metric series or logs, and use setMeasurement on Sentry transactions to surface custom metrics tied to errors.