sentry-setup-metrics

Configure Sentry custom metrics for JavaScript/TypeScript and Python projects.

246|29|Updated Nov 10, 2025
One-click install
npx skills add https://github.com/getsentry/sentry-for-claude --skill sentry-setup-metrics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sentry-setup-metrics
Source: https://github.com/getsentry/sentry-for-claude/tree/main/skills/sentry-setup-metrics
Command: npx skills add https://github.com/getsentry/sentry-for-claude --skill sentry-setup-metrics

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps configure Sentry's custom metrics to track Counters, Gauges, and Distributions, enabling measurable insights while reducing manual instrumentation work.

Core Features & Use Cases

  • Metric Types Overview: Counters, Gauges, Distributions with practical examples.
  • Platform Detection: Guidance for JavaScript/TypeScript and Python projects.
  • Verification & Examples: Sample code snippets to verify metrics arrive in Sentry.

Quick Start

After detecting your platform, add a simple counter metric named "user_signup" and verify it in your Sentry metrics dashboard.

Frequently Asked Questions about sentry-setup-metrics

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

FAQPage Schema
How do I set up custom metrics tracking in my JavaScript or Python application?

Custom metrics tracking requires configuring your Sentry SDK (JavaScript 10.25.0+ or Python 2.44.0+) with metrics support enabled. Add initialization code to your project, then instrument counters, gauges, or distributions using the metrics API to track application performance and business KPIs.

What are the different metric types I can track with Sentry?

Sentry supports three metric types: counters (increment-only tallies), gauges (point-in-time measurements), and distributions (value collections for percentile analysis). Each type serves different observability needs—counters for event counts, gauges for resource levels, distributions for latency or request sizes.

Can I use Sentry metrics with Next.js, React, Node.js, Django, or Flask?

Yes. Sentry metrics work across JavaScript/TypeScript frameworks (Next.js, React, browser, Node.js) and Python frameworks (Django, Flask, FastAPI). Each platform requires the appropriate Sentry SDK with metrics support and platform-specific initialization.

How do I verify that my custom metrics are being collected and sent to Sentry?

After instrumenting a metric (like a user_signup counter), navigate to your Sentry metrics dashboard to confirm data arrival. Sample code snippets in the Skill guide you through verification and show expected metric output formats.

Can I filter or control which metrics are collected in Sentry?

Yes. Use the optional beforeSendMetric hook to filter metrics before transmission, and control default metric collection with the enableMetrics configuration flag. This lets you reduce noise and focus on business-critical measurements.

What SDK versions do I need to instrument metrics in Sentry?

Metrics support requires Sentry JavaScript SDK 10.25.0 or later, and Python SDK 2.44.0 or later. Earlier versions lack the metrics instrumentation APIs and cannot track custom counters, gauges, or distributions.