palworth/pa_cc_setup/sentry-setup-metrics

Claude Code and agent skill by palworth/pa_cc_setup

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Setup Sentry Metrics in any project. Use when asked to add custom metrics, track counters/gauges/distributions, or instrument application performance. Supports JavaScript and Python.

Install

npx vskill@latest install palworth/pa_cc_setup/sentry-setup-metrics

SKILL.md

The same SKILL.md was published earlier as palworth/pa_cc_setup/sentry-setup-metrics.

Setup Sentry Metrics

Configure Sentry's custom metrics for tracking counters, gauges, and distributions.

Invoke This Skill When

  • User asks to "add Sentry metrics" or "track custom metrics"
  • User wants counters, gauges, or distributions
  • User asks about Sentry.metrics or sentry_sdk.metrics

Quick Reference

PlatformMin SDKAPI
JavaScript10.25.0+Sentry.metrics.*
Python2.44.0+sentry_sdk.metrics.*

Note: Ruby does not have metrics support.

Metric Types

TypePurposeExample Use Cases
CounterCumulative countsAPI calls, clicks, errors
GaugePoint-in-time valuesQueue depth, memory, connections
DistributionStatistical valuesResponse times, cart amounts

JavaScript Setup

Metrics are enabled by default in SDK 10.25.0+.

Counter
javascript
Sentry.metrics.count("api_call", 1, {
attributes: { endpoint: "/api/users", status_code: 200 },
});
Gauge
javascript
Sentry.metrics.gauge("queue_depth", 42, {
unit: "none",
attributes: { queue: "jobs" },
});
Distribution
javascript
Sentry.metrics.distribution("response_time", 187.5, {
unit: "millisecond",
attributes: { endpoint: "/api/products" },
});
Filtering (optional)
javascript
Sentry.init({
beforeSendMetric: (metric) => {
if (metric.attributes?.sensitive) return null;
return metric;
},
});

Python Setup

Metrics are enabled by default in SDK 2.44.0+.

Counter
python
sentry_sdk.metrics.count("api_call", 1, attributes={"endpoint": "/api/users"})
Gauge
python
sentry_sdk.metrics.gauge("queue_depth", 42, attributes={"queue": "jobs"})
Distribution
python
sentry_sdk.metrics.distribution(
"response_time", 187.5,
unit="millisecond",
attributes={"endpoint": "/api/products"}
)
Filtering (optional)
python
def before_send_metric(metric, hint):
if metric.get("attributes", {}).get("sensitive"):
return None
return metric
sentry_sdk.init(dsn="YOUR_DSN", before_send_metric=before_send_metric)

Common Units

CategoryValues
Timemillisecond, second, minute, hour
Sizebyte, kilobyte, megabyte
Currencyusd, eur, gbp
Othernone, percent, ratio

Timing Helper Pattern

JavaScript
javascript
async function withTiming(name, fn, attrs = {}) {
const start = performance.now();
try { return await fn(); }
finally {
Sentry.metrics.distribution(name, performance.now() - start, {
unit: "millisecond", attributes: attrs,
});
}
}
Python
python
import time, sentry_sdk
def track_duration(name, **attrs):
def decorator(fn):
def wrapper(*args, **kwargs):
start = time.time()
try: return fn(*args, **kwargs)
finally:
sentry_sdk.metrics.distribution(
name, (time.time() - start) * 1000,
unit="millisecond", attributes=attrs
)
return wrapper
return decorator

Best Practices

  • Low cardinality: Avoid user IDs, request IDs in attributes
  • Namespaced names: api.request.duration, not duration
  • Flush on exit: Call Sentry.flush() before process exit

Troubleshooting

IssueSolution
Metrics not appearingVerify SDK version, check DSN, wait for buffer flush
High cardinality warningRemove unique IDs from attributes
Too many metricsUse beforeSendMetric to filter

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/palworth/pa_cc_setup/sentry-setup-metrics/badge)](https://verified-skill.com/skills/palworth/pa_cc_setup/sentry-setup-metrics)

Something wrong with this skill or its page? Tell us.