
sentry-setup-tracing
Setup Sentry Tracing (Performance Monitoring) in any project. Use when asked to enable tracing, track transactions/spans, measure latency, or add performance monitoring. Supports JavaScript, Python, and Ruby.
- Installs
- 253
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/getsentry/sentry-agent-skills --skill sentry-setup-tracing- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads sentry-setup-tracing automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Setup Sentry Tracing
Configure Sentry's performance monitoring to track transactions and spans.
Invoke This Skill When
- User asks to "enable tracing" or "add performance monitoring"
- User wants to track API response times, page loads, or latency
- User asks about
tracesSampleRateor custom spans
Important: The SDK versions, API names, and code samples below are examples. Always verify against docs.sentry.io before implementing, as APIs and minimum versions may have changed.
Quick Reference
| Platform | Min SDK | Enable | Custom Span |
|---|---|---|---|
| JS/Browser | 9.0.0+ | tracesSampleRate + browserTracingIntegration() | Sentry.startSpan() |
| Next.js | 9.0.0+ | tracesSampleRate in each runtime config file | Sentry.startSpan() |
| Node.js | 9.0.0+ | tracesSampleRate | Sentry.startSpan() |
| Python | 0.11.2+ | traces_sample_rate | @sentry_sdk.trace or start_span() |
| Ruby | 5.0.0+ | traces_sample_rate | Sentry.with_child_span() |
JavaScript Setup
Enable tracing
Sentry.init({
dsn: "YOUR_DSN",
tracesSampleRate: 1.0, // 1.0 = 100%, lower for production
integrations: [Sentry.browserTracingIntegration()], // Browser/React only
tracePropagationTargets: ["localhost", /^https:\/\/api\./],
});
Custom spans
// Async operation
const result = await Sentry.startSpan(
{ name: "fetch-user", op: "http.client" },
async () => {
return await fetch("/api/user").then(r => r.json());
}
);
// Nested spans
await Sentry.startSpan({ name: "checkout", op: "transaction" }, async () => {
await Sentry.startSpan({ name: "validate", op: "validation" }, validateCart);
await Sentry.startSpan({ name: "payment", op: "payment" }, processPayment);
});
Dynamic sampling
tracesSampler: ({ name, inheritOrSampleWith }) => {
if (name.includes("healthcheck")) return 0;
if (name.includes("checkout")) return 1.0;
return inheritOrSampleWith(0.1); // Respects parent sampling decision, falls back to 0.1
},
Python Setup
Enable tracing
sentry_sdk.init(
dsn="YOUR_DSN",
traces_sample_rate=1.0,
)
Custom spans
# Decorator
@sentry_sdk.trace
def expensive_function():
return do_work()
# Context manager
with sentry_sdk.start_span(name="process-order", op="task") as span:
span.set_data("order.id", order_id)
process(order_id)
Dynamic sampling
from sentry_sdk.types import SamplingContext
def traces_sampler(sampling_context: SamplingContext) -> float:
name = sampling_context.get("transaction_context", {}).get("name", "")
parent_sampled = sampling_context.get("parent_sampled")
if "healthcheck" in name: return 0
if "checkout" in name: return 1.0
if parent_sampled is not None: return float(parent_sampled) # Respect parent decision
return 0.1
sentry_sdk.init(dsn="YOUR_DSN", traces_sampler=traces_sampler)
Ruby Setup
Sentry.init do |config|
config.dsn = "YOUR_DSN"
config.traces_sample_rate = 1.0
end
Common Operation Types
op Value | Use Case |
|---|---|
http.client | Outgoing HTTP |
http.server | Incoming HTTP |
db / db.query | Database |
cache | Cache operations |
queue.task | Background jobs |
function | Function calls |
Sampling Recommendations
| Traffic | Rate |
|---|---|
| Development | 1.0 |
| Low (<1K req/min) | 0.5 - 1.0 |
| Medium (1K-10K) | 0.1 - 0.5 |
| High (>10K) | 0.01 - 0.1 |
Distributed Tracing
Configure tracePropagationTargets to send trace headers to your APIs:
tracePropagationTargets: ["localhost", "https://api.yourapp.com"],
For Next.js 14 App Router, add to root layout (not needed in Next.js 15+):
export function generateMetadata(): Metadata {
return { other: { ...Sentry.getTraceData() } };
}
Verification
After enabling tracing, trigger a traced operation (e.g., an HTTP request) and check the Sentry Performance dashboard for transactions. Custom spans should appear nested under the parent transaction.
Troubleshooting
| Issue | Solution |
|---|---|
| Transactions not appearing | Check tracesSampleRate > 0, verify DSN |
| Browser traces missing | Add browserTracingIntegration() |
| Distributed traces disconnected | Check tracePropagationTargets, CORS headers |
| Too many transactions | Lower sample rate, use tracesSampler to filter |
FAQ
What does the sentry-setup-tracing skill do?
Setup Sentry Tracing (Performance Monitoring) in any project. Use when asked to enable tracing, track transactions/spans, measure latency, or add performance monitoring. Supports JavaScript, Python, and Ruby.
How do I install sentry-setup-tracing?
Run npx skills add https://github.com/getsentry/sentry-agent-skills --skill sentry-setup-tracing in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/sentry-setup-tracing/ (personal) or .claude/skills/sentry-setup-tracing/ (project).
Which AI agents can use sentry-setup-tracing?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is sentry-setup-tracing safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains sentry-setup-tracing?
It is published by getsentry in getsentry/sentry-agent-skills, and it is an official skill from the maker of the technology it covers. It has 253 recorded installs.
More from getsentry/sentry-agent-skills
sentry-fix-issues
getsentry/sentry-agent-skills
Find and fix issues from Sentry using MCP. Use when asked to fix Sentry errors, debug production issues, investigate exceptions, or resolve bugs reported in Sentry. Methodically analyzes stack traces, breadcrumbs, traces, and context to identify root causes.
sentry-react-setup
getsentry/sentry-agent-skills
Setup Sentry in React apps. Use when asked to add Sentry to React, install @sentry/react, or configure error monitoring, error boundaries, session replay, or browser tracing for React applications.
sentry-setup-ai-monitoring
getsentry/sentry-agent-skills
Setup Sentry AI Agent Monitoring in any project. Use when asked to monitor LLM calls, track AI agents, or instrument OpenAI/Anthropic/Vercel AI/LangChain/Google GenAI/Pydantic AI. Detects installed AI SDKs and configures appropriate integrations.
sentry-nextjs-sdk
getsentry/sentry-agent-skills
Full Sentry SDK setup for Next.js. Use when asked to "add Sentry to Next.js", "install @sentry/nextjs", or configure error monitoring, tracing, session replay, logging, profiling, AI monitoring, or crons for Next.js applications. Supports Next.js 13+ with App Router and Pages Router.
sentry-pr-code-review
getsentry/sentry-agent-skills
Review a project's PRs to check for issues detected in code review by Seer Bug Prediction. Use when asked to review or fix issues identified by Sentry in PR comments, or to find recent PRs with Sentry feedback.
sentry-create-alert
getsentry/sentry-agent-skills
Create Sentry alerts using the workflow engine API. Use when asked to create alerts, set up notifications, configure issue priority alerts, or build workflow automations. Supports email, Slack, PagerDuty, Discord, and other notification actions.
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.