sentry-instrumentation

Enforce governed Sentry metric schemas, tagging, and emission patterns.

24|1|Updated Apr 17, 2026
One-click install
npx skills add https://github.com/tortastudios/sentry-instrumentation --skill sentry-instrumentation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sentry-instrumentation
Source: https://github.com/tortastudios/sentry-instrumentation/tree/main
Command: npx skills add https://github.com/tortastudios/sentry-instrumentation --skill sentry-instrumentation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill prevents metric sprawl, tag cardinality explosions, and silent metric drift by forcing a governed contract for how Sentry system metrics are named, tagged, emitted, and versioned.

Core Features & Use Cases

  • Governed metric grammar: consistent MetricDef schemas, constructors, naming rules, and lifecycle/versioning guarantees across codebases.
  • Safe tagging & failure taxonomy: closed sets for tag values and bounded failure classes using classify(), never raw exception strings.
  • Correct emission patterns by surface: standardized instrumentation for HTTP routes, external API calls, workflow steps, retry loops, and fallback paths.
  • Cost and loop safety: sampling, rate limiting, and loop aggregation enforcement to keep Sentry bills predictable.
  • CI and test enforcement: AST-based checks plus pytest gates block invalid metrics before merge.

Quick Start

Ask your AI coding agent to instrument the external API client calls using the skill’s InstrumentedHttpClient pattern and standard triad (counter + latency + failure).

Frequently Asked Questions about sentry-instrumentation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent Sentry metric sprawl and tag cardinality explosions in production?

To prevent Sentry metric sprawl and tag cardinality explosions, enforce a governed contract using MetricDef schemas, bounded tag value constraints, and bucket functions. This ensures consistent naming, safe tagging, and prevents silent metric drift across production codebases.

What is the best way to instrument HTTP routes and external API calls for Sentry metrics?

The best way to instrument HTTP routes and external API calls for Sentry metrics is using standardized emission patterns like the InstrumentedHttpClient. This applies a standard triad of counter, latency, and failure metrics to ensure consistent observability across dependency surfaces.

How do I enforce Sentry metric governance rules in CI pipelines?

You can enforce Sentry metric governance rules in CI pipelines using a 13-check CI gate. This gate applies AST-based checks alongside pytest gates to automatically block invalid, noncompliant metric emissions before code merges.

Why should I use a failure taxonomy instead of raw exception strings for Sentry failure counters?

You should use a failure taxonomy instead of raw exception strings to prevent unbounded tag cardinality. The classify() function maps errors to closed sets of bounded failure classes, keeping Sentry billing predictable while maintaining accurate failure counters.

How do I safely add retry loop and fallback path instrumentation without spiking Sentry costs?

To safely add retry loop and fallback path instrumentation without spiking Sentry costs, apply enforced sampling, rate limiting, and loop aggregation policies. These cost and loop safety rules prevent metric emission floods during recursive failures or retry storms.

Does this Sentry instrumentation approach work with existing pytest test suites?

Yes, this Sentry instrumentation approach works with existing pytest test suites by integrating AST-based checks and pytest gates. These tests validate MetricDef schema compliance and reject noncompliant metric emissions directly within your current testing workflow.