[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M795Q545MC4JCVANQTVE35YB":3,"skill-same:01M795Q545MC4JCVANQTVE35YB":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M795Q545MC4JCVANQTVE35YB","sentry-observability",null,"Integrate Sentry with your observability stack — logging, metrics, APM, and dashboards.\nUse when connecting Sentry to winston\u002Fpino\u002Fstructlog, correlating errors with business\nmetrics, deciding between Sentry performance and Datadog\u002FNew Relic, building Sentry\nDiscover dashboards, or linking events to external tools via extra context.\nTrigger: \"sentry observability\", \"sentry logging\", \"sentry metrics\", \"sentry grafana\",\n\"sentry datadog correlation\", \"sentry discover dashboard\".","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--sentry-pack--sentry-observability\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: sentry-observability\ndescription: |\n  Integrate Sentry with your observability stack — logging, metrics, APM, and dashboards.\n  Use when connecting Sentry to winston\u002Fpino\u002Fstructlog, correlating errors with business\n  metrics, deciding between Sentry performance and Datadog\u002FNew Relic, building Sentry\n  Discover dashboards, or linking events to external tools via extra context.\n  Trigger: \"sentry observability\", \"sentry logging\", \"sentry metrics\", \"sentry grafana\",\n  \"sentry datadog correlation\", \"sentry discover dashboard\".\nallowed-tools: Read, Write, Edit, Grep, Bash(node:*), Bash(npx:*), Bash(pip:*)\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ncompatible-with: claude-code, codex, openclaw\ntags: [saas, sentry, observability, logging, metrics, apm, grafana, opentelemetry]\n---\n# Sentry Observability Integration\n\n## Overview\n\nWire Sentry into your logging, metrics, APM, and dashboard toolchain so every error carries full context and every metric correlates back to root-cause events. This skill covers three integration layers: structured logging (winston, pino, structlog) with Sentry event ID correlation, business metrics with error-rate tracking, and cross-tool linking via Sentry Discover, Grafana webhooks, and APM tools.\n\nSee also: [Logging integration details](references\u002Flogging-integration.md) | [Metrics patterns](references\u002Fmetrics-integration.md) | [APM tool cross-linking](references\u002Fapm-tool-integration.md)\n\n## Prerequisites\n\n- Sentry SDK v8+ installed (`@sentry\u002Fnode` for Node.js, `sentry-sdk` for Python)\n- At least one structured logger configured (winston, pino, or structlog)\n- Sentry project DSN available in environment (`SENTRY_DSN`)\n- Dashboard platform accessible (Sentry Discover, Grafana, or Datadog)\n- Alert routing strategy decided (who gets paged, where warnings go)\n\n## Instructions\n\n### Step 1 — Attach Sentry Event IDs to Structured Logs\n\nThe core pattern: every log line that triggers a Sentry event carries the event ID, and every Sentry event carries the log context. This creates a two-way link between your log aggregator and Sentry.\n\n**Winston (Node.js) — custom transport:**\n\n```typescript\nimport winston from 'winston';\nimport * as Sentry from '@sentry\u002Fnode';\n\nclass SentryTransport extends winston.Transport {\n  log(info: any, callback: () => void) {\n    setImmediate(callback);\n\n    if (info.level === 'error' || info.level === 'fatal') {\n      const error = info.error instanceof Error\n        ? info.error\n        : new Error(info.message);\n\n      Sentry.withScope((scope) => {\n        scope.setTag('logger', 'winston');\n        scope.setContext('log_entry', {\n          level: info.level,\n          timestamp: info.timestamp,\n          service: info.service,\n        });\n        const eventId = Sentry.captureException(error);\n        info.sentry_event_id = eventId;\n        info.sentry_url = `https:\u002F\u002F${process.env.SENTRY_ORG}.sentry.io\u002Fissues\u002F?query=${eventId}`;\n      });\n    }\n  }\n}\n\nconst logger = winston.createLogger({\n  defaultMeta: { service: 'api-gateway' },\n  transports: [\n    new winston.transports.Console({ format: winston.format.json() }),\n    new SentryTransport(),\n  ],\n});\n```\n\n**Pino (Node.js) — hooks pattern:**\n\n```typescript\nimport pino from 'pino';\nimport * as Sentry from '@sentry\u002Fnode';\n\nconst logger = pino({\n  hooks: {\n    logMethod(inputArgs, method, level) {\n      if (level >= 50) { \u002F\u002F 50 = error, 60 = fatal\n        const [obj, msg] = typeof inputArgs[0] === 'object'\n          ? [inputArgs[0], inputArgs[1]]\n          : [{}, inputArgs[0]];\n\n        Sentry.withScope((scope) => {\n          scope.setTag('logger', 'pino');\n          const eventId = Sentry.captureException(\n            obj.err instanceof Error ? obj.err : new Error(String(msg))\n          );\n          if (typeof inputArgs[0] === 'object') {\n            inputArgs[0].sentry_event_id = eventId;\n          }\n        });\n      }\n      return method.apply(this, inputArgs);\n    },\n  },\n});\n```\n\nFor Python structlog integration, see [logging-integration.md](references\u002Flogging-integration.md).\n\n**Request ID correlation middleware:**\n\n```typescript\nimport { randomUUID } from 'crypto';\nimport * as Sentry from '@sentry\u002Fnode';\n\napp.use((req, res, next) => {\n  const requestId = (req.headers['x-request-id'] as string) || randomUUID();\n  req.requestId = requestId;\n  res.setHeader('x-request-id', requestId);\n  Sentry.setTag('request_id', requestId);\n  req.log = logger.child({ requestId, path: req.path });\n  next();\n});\n```\n\n### Step 2 — Correlate Errors with Business Metrics and APM\n\nConnect Sentry events to your metrics pipeline and decide when Sentry performance monitoring is sufficient versus when to add Datadog or New Relic.\n\n**Sentry custom metrics (built-in, no extra tools):**\n\n```typescript\nimport * as Sentry from '@sentry\u002Fnode';\n\n\u002F\u002F Counter — track error rates alongside business events\nSentry.metrics.increment('checkout.attempted', 1, {\n  tags: { payment_provider: 'stripe', plan: 'enterprise' },\n});\n\nSentry.metrics.increment('checkout.failed', 1, {\n  tags: { payment_provider: 'stripe', failure_reason: 'timeout' },\n});\n\n\u002F\u002F Distribution — track latency with error correlation\nSentry.metrics.distribution('api.response_time', responseTimeMs, {\n  tags: { endpoint: '\u002Fapi\u002Forders', status_code: String(res.statusCode) },\n  unit: 'millisecond',\n});\n\n\u002F\u002F Gauge — track queue depth, connection pool size\nSentry.metrics.gauge('db.pool.active', pool.activeCount, {\n  tags: { database: 'primary' },\n});\n\n\u002F\u002F Set — track unique affected users during incidents\nSentry.metrics.set('incident.affected_users', userId, {\n  tags: { incident: 'payment-outage-2026-03' },\n});\n```\n\nFor Prometheus dual-write patterns, see [metrics-integration.md](references\u002Fmetrics-integration.md).\n\n**When to use Sentry performance vs Datadog\u002FNew Relic:**\n\n| Scenario | Use Sentry Performance | Use Datadog\u002FNew Relic |\n|----------|----------------------|----------------------|\n| Frontend + backend in one view | Yes — unified error + perf traces | Overkill if Sentry covers your stack |\n| Infrastructure metrics (CPU, memory) | No — Sentry does not collect infra | Yes — native host agent collection |\n| 100+ custom metric series | Limited query constraints | Yes — built for high-cardinality |\n| Budget-constrained, \u003C 5 services | Yes — one tool, one bill | Unnecessary cost |\n\n**Datadog + Sentry cross-linking via `beforeSend`:**\n\n```typescript\nimport tracer from 'dd-trace';\nimport * as Sentry from '@sentry\u002Fnode';\n\n\u002F\u002F dd-trace MUST be initialized before @sentry\u002Fnode\nSentry.init({\n  dsn: process.env.SENTRY_DSN,\n  beforeSend(event) {\n    const span = tracer.scope().active();\n    if (span) {\n      const traceId = span.context().toTraceId();\n      event.tags = { ...event.tags, 'dd.trace_id': traceId };\n      event.contexts = {\n        ...event.contexts,\n        datadog: {\n          trace_url: `https:\u002F\u002Fapp.datadoghq.com\u002Fapm\u002Ftrace\u002F${traceId}`,\n          trace_id: traceId,\n        },\n      };\n    }\n    return event;\n  },\n});\n```\n\nFor New Relic correlation patterns, see [apm-tool-integration.md](references\u002Fapm-tool-integration.md).\n\n### Step 3 — Build Dashboards and Connect External Tools\n\nUse Sentry Discover for error analytics, set up Grafana webhooks for unified dashboards, and link Sentry events to external tools via `setContext`.\n\n**Linking all tools via `Sentry.setContext('monitoring', ...)`:**\n\n```typescript\nimport * as Sentry from '@sentry\u002Fnode';\n\nfunction setMonitoringContext(req: Request) {\n  const traceId = Sentry.getActiveSpan()?.spanContext().traceId;\n  const spanId = Sentry.getActiveSpan()?.spanContext().spanId;\n  const requestId = req.headers['x-request-id'] as string || crypto.randomUUID();\n\n  \u002F\u002F setContext creates a named section in the Sentry event sidebar\n  Sentry.setContext('monitoring', {\n    traceId,\n    spanId,\n    requestId,\n    grafana_dashboard: `https:\u002F\u002Fgrafana.example.com\u002Fd\u002Fabc123?var-trace_id=${traceId}`,\n    kibana_logs: `https:\u002F\u002Fkibana.example.com\u002Fapp\u002Flogs?query=request_id:${requestId}`,\n    datadog_trace: traceId\n      ? `https:\u002F\u002Fapp.datadoghq.com\u002Fapm\u002Ftrace\u002F${traceId}`\n      : undefined,\n  });\n\n  Sentry.setTag('request_id', requestId);\n  Sentry.setTag('trace_id', traceId || 'none');\n  Sentry.setTag('deployment', process.env.DEPLOYMENT_ID || 'unknown');\n}\n\napp.use((req, res, next) => {\n  setMonitoringContext(req);\n  next();\n});\n```\n\n**Grafana integration via Sentry webhooks:**\n\nConfigure in Settings > Integrations > Internal Integrations. Point the webhook URL at a receiver that transforms Sentry events into Grafana annotations:\n\n```typescript\n\u002F\u002F Receive Sentry webhook, create Grafana annotation\napp.post('\u002Fsentry-to-grafana', async (req, res) => {\n  const { event } = req.body;\n  if (!event) return res.status(200).send('ignored');\n\n  await fetch(`${process.env.GRAFANA_URL}\u002Fapi\u002Fannotations`, {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application\u002Fjson',\n      Authorization: `Bearer ${process.env.GRAFANA_API_KEY}`,\n    },\n    body: JSON.stringify({\n      dashboardUID: process.env.GRAFANA_DASHBOARD_UID,\n      panelId: 1,\n      time: new Date(event.datetime).getTime(),\n      tags: ['sentry', event.level, event.project],\n      text: `**${event.title}**\\nLevel: ${event.level}\\n[View in Sentry](${event.web_url})`,\n    }),\n  });\n\n  res.status(201).json({ status: 'annotation_created' });\n});\n```\n\n**Alert routing across tools:**\n\n```\nIssue Alert: \"Critical Production Error\"\n  When: An event is first seen\n  If: level is fatal AND environment is production\n  Then: PagerDuty (Critical) + #alerts-critical Slack + Grafana annotation\n  Frequency: Once per issue\n\nMetric Alert: \"Error Rate Spike\"\n  When: Error count > 50 in 5 minutes\n  Then: PagerDuty (High) + #alerts-production Slack + webhook to Grafana\n  Resolve: Error count \u003C 5 for 10 minutes\n\nMetric Alert: \"Latency Regression\"\n  When: p95(transaction.duration) for \u002Fapi\u002F* > 2000ms for 10 minutes\n  Then: #alerts-performance Slack + JIRA ticket via webhook\n  Resolve: p95 \u003C 1000ms for 15 minutes\n```\n\n## Output\n\nAfter completing these steps you will have:\n\n- Winston\u002Fpino\u002Fstructlog forwarding errors to Sentry with event IDs stamped into log lines\n- Sentry custom metrics (counters, gauges, distributions, sets) tracking business KPIs\n- `beforeSend` hooks linking Sentry events to Datadog traces and New Relic transactions\n- `Sentry.setContext('monitoring', { traceId, spanId })` linking every event to external tool URLs\n- Grafana annotations created from Sentry webhooks on infrastructure dashboards\n- Tiered alert routing: fatal errors page on-call, warnings go to Slack, latency issues create tickets\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| Sentry event IDs missing from logs | Transport\u002Fprocessor not wired up | Verify `SentryTransport` is in Winston transports or `sentry_processor` is in structlog chain |\n| `beforeSend` silently dropping events | Handler throws or returns `undefined` | Wrap `beforeSend` in try\u002Fcatch, always return `event` on error paths |\n| Grafana annotations not appearing | Webhook URL wrong or API key expired | Test webhook with `curl -X POST` first; check Grafana API key has annotation write |\n| Datadog trace IDs not matching | `dd-trace` not initialized before Sentry | Import and init `dd-trace` before `@sentry\u002Fnode` |\n| Sentry metrics not visible | Feature not enabled on plan | Custom metrics require Business plan or higher |\n| Duplicate events from logger | SDK auto-capture and transport both fire | Use `beforeSend` to deduplicate, or disable auto-capture for handled errors |\n| Webhook payload format changed | Sentry API version upgrade | Pin webhook to API v0; validate payload shape in receiver |\n\n## Examples\n\n**Example 1 — Full-stack request tracing with log correlation**\n\nRequest: \"Every error in our Express API should show up in both our log aggregator and Sentry with cross-links.\"\n\n```typescript\nimport express from 'express';\nimport pino from 'pino';\nimport * as Sentry from '@sentry\u002Fnode';\nimport { randomUUID } from 'crypto';\n\nSentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 0.1 });\nconst logger = pino({ level: 'info' });\nconst app = express();\n\napp.use((req, res, next) => {\n  const requestId = (req.headers['x-request-id'] as string) || randomUUID();\n  req.requestId = requestId;\n  res.setHeader('x-request-id', requestId);\n  Sentry.setTag('request_id', requestId);\n  req.log = logger.child({ requestId, path: req.path, method: req.method });\n  next();\n});\n\napp.get('\u002Fapi\u002Forders\u002F:id', async (req, res) => {\n  try {\n    const order = await db.orders.findById(req.params.id);\n    if (!order) {\n      req.log.warn({ orderId: req.params.id }, 'Order not found');\n      return res.status(404).json({ error: 'Not found' });\n    }\n    res.json(order);\n  } catch (error) {\n    Sentry.withScope((scope) => {\n      scope.setContext('request', { params: req.params, requestId: req.requestId });\n      const eventId = Sentry.captureException(error);\n      req.log.error({\n        err: error,\n        sentry_event_id: eventId,\n        sentry_url: `https:\u002F\u002Fsentry.io\u002Fissues\u002F?query=${eventId}`,\n      }, 'Order fetch failed');\n    });\n    res.status(500).json({ error: 'Internal error', request_id: req.requestId });\n  }\n});\n\nSentry.setupExpressErrorHandler(app);\n```\n\n**Example 2 — Grafana dashboard with Sentry error annotations**\n\nRequest: \"Show Sentry errors as annotations on our Grafana latency dashboard.\"\n\nResult: Create a Sentry internal integration (Settings > Integrations > Internal Integrations) with a webhook URL pointing to your annotation receiver. The receiver transforms Sentry event payloads into Grafana annotation API calls. Error events appear as vertical markers on latency graphs with clickable links back to the Sentry issue.\n\nSee [examples.md](references\u002Fexamples.md) for additional integration patterns.\n\n## Resources\n\n- [Sentry + OpenTelemetry](https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fnode\u002Ftracing\u002Finstrumentation\u002Fopentelemetry\u002F) — SDK v8 OTel bridge\n- [Custom Metrics](https:\u002F\u002Fdocs.sentry.io\u002Fproduct\u002Fexplore\u002Fmetrics\u002F) — counters, gauges, distributions, sets\n- [Sentry Discover Queries](https:\u002F\u002Fdocs.sentry.io\u002Fproduct\u002Fexplore\u002Fdiscover-queries\u002F) — custom event analytics\n- [Webhooks Integration](https:\u002F\u002Fdocs.sentry.io\u002Forganization\u002Fintegrations\u002Fintegration-platform\u002Fwebhooks\u002F) — outbound event webhooks\n- [PagerDuty Integration](https:\u002F\u002Fdocs.sentry.io\u002Forganization\u002Fintegrations\u002Fnotification-incidents\u002Fpagerduty\u002F) — incident routing\n- [Slack Integration](https:\u002F\u002Fdocs.sentry.io\u002Forganization\u002Fintegrations\u002Fnotification-incidents\u002Fslack\u002F) — alert channels\n\n## Next Steps\n\n- Configure sentry-performance-tracing for transaction-level instrumentation\n- Set up sentry-release-management to correlate deploys with error regressions\n- Add sentry-ci-integration to catch regressions before they reach production\n- Review sentry-cost-tuning to manage event volume as observability coverage expands\n","# Sentry Observability Integration\n\n## Overview\n\nWire Sentry into your logging, metrics, APM, and dashboard toolchain so every error carries full context and every metric correlates back to root-cause events. This skill covers three integration layers: structured logging (winston, pino, structlog) with Sentry event ID correlation, business metrics with error-rate tracking, and cross-tool linking via Sentry Discover, Grafana webhooks, and APM tools.\n\nSee also: [Logging integration details](references\u002Flogging-integration.md) | [Metrics patterns](references\u002Fmetrics-integration.md) | [APM tool cross-linking](references\u002Fapm-tool-integration.md)\n\n## Prerequisites\n\n- Sentry SDK v8+ installed (`@sentry\u002Fnode` for Node.js, `sentry-sdk` for Python)\n- At least one structured logger configured (winston, pino, or structlog)\n- Sentry project DSN available in environment (`SENTRY_DSN`)\n- Dashboard platform accessible (Sentry Discover, Grafana, or Datadog)\n- Alert routing strategy decided (who gets paged, where warnings go)\n\n## Instructions\n\n### Step 1 — Attach Sentry Event IDs to Structured Logs\n\nThe core pattern: every log line that triggers a Sentry event carries the event ID, and every Sentry event carries the log context. This creates a two-way link between your log aggregator and Sentry.\n\n**Winston (Node.js) — custom transport:**\n\n```typescript\nimport winston from 'winston';\nimport * as Sentry from '@sentry\u002Fnode';\n\nclass SentryTransport extends winston.Transport {\n  log(info: any, callback: () => void) {\n    setImmediate(callback);\n\n    if (info.level === 'error' || info.level === 'fatal') {\n      const error = info.error instanceof Error\n        ? info.error\n        : new Error(info.message);\n\n      Sentry.withScope((scope) => {\n        scope.setTag('logger', 'winston');\n        scope.setContext('log_entry', {\n          level: info.level,\n          timestamp: info.timestamp,\n          service: info.service,\n        });\n        const eventId = Sentry.captureException(error);\n        info.sentry_event_id = eventId;\n        info.sentry_url = `https:\u002F\u002F${process.env.SENTRY_ORG}.sentry.io\u002Fissues\u002F?query=${eventId}`;\n      });\n    }\n  }\n}\n\nconst logger = winston.createLogger({\n  defaultMeta: { service: 'api-gateway' },\n  transports: [\n    new winston.transports.Console({ format: winston.format.json() }),\n    new SentryTransport(),\n  ],\n});\n```\n\n**Pino (Node.js) — hooks pattern:**\n\n```typescript\nimport pino from 'pino';\nimport * as Sentry from '@sentry\u002Fnode';\n\nconst logger = pino({\n  hooks: {\n    logMethod(inputArgs, method, level) {\n      if (level >= 50) { \u002F\u002F 50 = error, 60 = fatal\n        const [obj, msg] = typeof inputArgs[0] === 'object'\n          ? [inputArgs[0], inputArgs[1]]\n          : [{}, inputArgs[0]];\n\n        Sentry.withScope((scope) => {\n          scope.setTag('logger', 'pino');\n          const eventId = Sentry.captureException(\n            obj.err instanceof Error ? obj.err : new Error(String(msg))\n          );\n          if (typeof inputArgs[0] === 'object') {\n            inputArgs[0].sentry_event_id = eventId;\n          }\n        });\n      }\n      return method.apply(this, inputArgs);\n    },\n  },\n});\n```\n\nFor Python structlog integration, see [logging-integration.md](references\u002Flogging-integration.md).\n\n**Request ID correlation middleware:**\n\n```typescript\nimport { randomUUID } from 'crypto';\nimport * as Sentry from '@sentry\u002Fnode';\n\napp.use((req, res, next) => {\n  const requestId = (req.headers['x-request-id'] as string) || randomUUID();\n  req.requestId = requestId;\n  res.setHeader('x-request-id', requestId);\n  Sentry.setTag('request_id', requestId);\n  req.log = logger.child({ requestId, path: req.path });\n  next();\n});\n```\n\n### Step 2 — Correlate Errors with Business Metrics and APM\n\nConnect Sentry events to your metrics pipeline and decide when Sentry performance monitoring is sufficient versus when to add Datadog or New Relic.\n\n**Sentry custom metrics (built-in, no extra tools):**\n\n```typescript\nimport * as Sentry from '@sentry\u002Fnode';\n\n\u002F\u002F Counter — track error rates alongside business events\nSentry.metrics.increment('checkout.attempted', 1, {\n  tags: { payment_provider: 'stripe', plan: 'enterprise' },\n});\n\nSentry.metrics.increment('checkout.failed', 1, {\n  tags: { payment_provider: 'stripe', failure_reason: 'timeout' },\n});\n\n\u002F\u002F Distribution — track latency with error correlation\nSentry.metrics.distribution('api.response_time', responseTimeMs, {\n  tags: { endpoint: '\u002Fapi\u002Forders', status_code: String(res.statusCode) },\n  unit: 'millisecond',\n});\n\n\u002F\u002F Gauge — track queue depth, connection pool size\nSentry.metrics.gauge('db.pool.active', pool.activeCount, {\n  tags: { database: 'primary' },\n});\n\n\u002F\u002F Set — track unique affected users during incidents\nSentry.metrics.set('incident.affected_users', userId, {\n  tags: { incident: 'payment-outage-2026-03' },\n});\n```\n\nFor Prometheus dual-write patterns, see [metrics-integration.md](references\u002Fmetrics-integration.md).\n\n**When to use Sentry performance vs Datadog\u002FNew Relic:**\n\n| Scenario | Use Sentry Performance | Use Datadog\u002FNew Relic |\n|----------|----------------------|----------------------|\n| Frontend + backend in one view | Yes — unified error + perf traces | Overkill if Sentry covers your stack |\n| Infrastructure metrics (CPU, memory) | No — Sentry does not collect infra | Yes — native host agent collection |\n| 100+ custom metric series | Limited query constraints | Yes — built for high-cardinality |\n| Budget-constrained, \u003C 5 services | Yes — one tool, one bill | Unnecessary cost |\n\n**Datadog + Sentry cross-linking via `beforeSend`:**\n\n```typescript\nimport tracer from 'dd-trace';\nimport * as Sentry from '@sentry\u002Fnode';\n\n\u002F\u002F dd-trace MUST be initialized before @sentry\u002Fnode\nSentry.init({\n  dsn: process.env.SENTRY_DSN,\n  beforeSend(event) {\n    const span = tracer.scope().active();\n    if (span) {\n      const traceId = span.context().toTraceId();\n      event.tags = { ...event.tags, 'dd.trace_id': traceId };\n      event.contexts = {\n        ...event.contexts,\n        datadog: {\n          trace_url: `https:\u002F\u002Fapp.datadoghq.com\u002Fapm\u002Ftrace\u002F${traceId}`,\n          trace_id: traceId,\n        },\n      };\n    }\n    return event;\n  },\n});\n```\n\nFor New Relic correlation patterns, see [apm-tool-integration.md](references\u002Fapm-tool-integration.md).\n\n### Step 3 — Build Dashboards and Connect External Tools\n\nUse Sentry Discover for error analytics, set up Grafana webhooks for unified dashboards, and link Sentry events to external tools via `setContext`.\n\n**Linking all tools via `Sentry.setContext('monitoring', ...)`:**\n\n```typescript\nimport * as Sentry from '@sentry\u002Fnode';\n\nfunction setMonitoringContext(req: Request) {\n  const traceId = Sentry.getActiveSpan()?.spanContext().traceId;\n  const spanId = Sentry.getActiveSpan()?.spanContext().spanId;\n  const requestId = req.headers['x-request-id'] as string || crypto.randomUUID();\n\n  \u002F\u002F setContext creates a named section in the Sentry event sidebar\n  Sentry.setContext('monitoring', {\n    traceId,\n    spanId,\n    requestId,\n    grafana_dashboard: `https:\u002F\u002Fgrafana.example.com\u002Fd\u002Fabc123?var-trace_id=${traceId}`,\n    kibana_logs: `https:\u002F\u002Fkibana.example.com\u002Fapp\u002Flogs?query=request_id:${requestId}`,\n    datadog_trace: traceId\n      ? `https:\u002F\u002Fapp.datadoghq.com\u002Fapm\u002Ftrace\u002F${traceId}`\n      : undefined,\n  });\n\n  Sentry.setTag('request_id', requestId);\n  Sentry.setTag('trace_id', traceId || 'none');\n  Sentry.setTag('deployment', process.env.DEPLOYMENT_ID || 'unknown');\n}\n\napp.use((req, res, next) => {\n  setMonitoringContext(req);\n  next();\n});\n```\n\n**Grafana integration via Sentry webhooks:**\n\nConfigure in Settings > Integrations > Internal Integrations. Point the webhook URL at a receiver that transforms Sentry events into Grafana annotations:\n\n```typescript\n\u002F\u002F Receive Sentry webhook, create Grafana annotation\napp.post('\u002Fsentry-to-grafana', async (req, res) => {\n  const { event } = req.body;\n  if (!event) return res.status(200).send('ignored');\n\n  await fetch(`${process.env.GRAFANA_URL}\u002Fapi\u002Fannotations`, {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application\u002Fjson',\n      Authorization: `Bearer ${process.env.GRAFANA_API_KEY}`,\n    },\n    body: JSON.stringify({\n      dashboardUID: process.env.GRAFANA_DASHBOARD_UID,\n      panelId: 1,\n      time: new Date(event.datetime).getTime(),\n      tags: ['sentry', event.level, event.project],\n      text: `**${event.title}**\\nLevel: ${event.level}\\n[View in Sentry](${event.web_url})`,\n    }),\n  });\n\n  res.status(201).json({ status: 'annotation_created' });\n});\n```\n\n**Alert routing across tools:**\n\n```\nIssue Alert: \"Critical Production Error\"\n  When: An event is first seen\n  If: level is fatal AND environment is production\n  Then: PagerDuty (Critical) + #alerts-critical Slack + Grafana annotation\n  Frequency: Once per issue\n\nMetric Alert: \"Error Rate Spike\"\n  When: Error count > 50 in 5 minutes\n  Then: PagerDuty (High) + #alerts-production Slack + webhook to Grafana\n  Resolve: Error count \u003C 5 for 10 minutes\n\nMetric Alert: \"Latency Regression\"\n  When: p95(transaction.duration) for \u002Fapi\u002F* > 2000ms for 10 minutes\n  Then: #alerts-performance Slack + JIRA ticket via webhook\n  Resolve: p95 \u003C 1000ms for 15 minutes\n```\n\n## Output\n\nAfter completing these steps you will have:\n\n- Winston\u002Fpino\u002Fstructlog forwarding errors to Sentry with event IDs stamped into log lines\n- Sentry custom metrics (counters, gauges, distributions, sets) tracking business KPIs\n- `beforeSend` hooks linking Sentry events to Datadog traces and New Relic transactions\n- `Sentry.setContext('monitoring', { traceId, spanId })` linking every event to external tool URLs\n- Grafana annotations created from Sentry webhooks on infrastructure dashboards\n- Tiered alert routing: fatal errors page on-call, warnings go to Slack, latency issues create tickets\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| Sentry event IDs missing from logs | Transport\u002Fprocessor not wired up | Verify `SentryTransport` is in Winston transports or `sentry_processor` is in structlog chain |\n| `beforeSend` silently dropping events | Handler throws or returns `undefined` | Wrap `beforeSend` in try\u002Fcatch, always return `event` on error paths |\n| Grafana annotations not appearing | Webhook URL wrong or API key expired | Test webhook with `curl -X POST` first; check Grafana API key has annotation write |\n| Datadog trace IDs not matching | `dd-trace` not initialized before Sentry | Import and init `dd-trace` before `@sentry\u002Fnode` |\n| Sentry metrics not visible | Feature not enabled on plan | Custom metrics require Business plan or higher |\n| Duplicate events from logger | SDK auto-capture and transport both fire | Use `beforeSend` to deduplicate, or disable auto-capture for handled errors |\n| Webhook payload format changed | Sentry API version upgrade | Pin webhook to API v0; validate payload shape in receiver |\n\n## Examples\n\n**Example 1 — Full-stack request tracing with log correlation**\n\nRequest: \"Every error in our Express API should show up in both our log aggregator and Sentry with cross-links.\"\n\n```typescript\nimport express from 'express';\nimport pino from 'pino';\nimport * as Sentry from '@sentry\u002Fnode';\nimport { randomUUID } from 'crypto';\n\nSentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 0.1 });\nconst logger = pino({ level: 'info' });\nconst app = express();\n\napp.use((req, res, next) => {\n  const requestId = (req.headers['x-request-id'] as string) || randomUUID();\n  req.requestId = requestId;\n  res.setHeader('x-request-id', requestId);\n  Sentry.setTag('request_id', requestId);\n  req.log = logger.child({ requestId, path: req.path, method: req.method });\n  next();\n});\n\napp.get('\u002Fapi\u002Forders\u002F:id', async (req, res) => {\n  try {\n    const order = await db.orders.findById(req.params.id);\n    if (!order) {\n      req.log.warn({ orderId: req.params.id }, 'Order not found');\n      return res.status(404).json({ error: 'Not found' });\n    }\n    res.json(order);\n  } catch (error) {\n    Sentry.withScope((scope) => {\n      scope.setContext('request', { params: req.params, requestId: req.requestId });\n      const eventId = Sentry.captureException(error);\n      req.log.error({\n        err: error,\n        sentry_event_id: eventId,\n        sentry_url: `https:\u002F\u002Fsentry.io\u002Fissues\u002F?query=${eventId}`,\n      }, 'Order fetch failed');\n    });\n    res.status(500).json({ error: 'Internal error', request_id: req.requestId });\n  }\n});\n\nSentry.setupExpressErrorHandler(app);\n```\n\n**Example 2 — Grafana dashboard with Sentry error annotations**\n\nRequest: \"Show Sentry errors as annotations on our Grafana latency dashboard.\"\n\nResult: Create a Sentry internal integration (Settings > Integrations > Internal Integrations) with a webhook URL pointing to your annotation receiver. The receiver transforms Sentry event payloads into Grafana annotation API calls. Error events appear as vertical markers on latency graphs with clickable links back to the Sentry issue.\n\nSee [examples.md](references\u002Fexamples.md) for additional integration patterns.\n\n## Resources\n\n- [Sentry + OpenTelemetry](https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fnode\u002Ftracing\u002Finstrumentation\u002Fopentelemetry\u002F) — SDK v8 OTel bridge\n- [Custom Metrics](https:\u002F\u002Fdocs.sentry.io\u002Fproduct\u002Fexplore\u002Fmetrics\u002F) — counters, gauges, distributions, sets\n- [Sentry Discover Queries](https:\u002F\u002Fdocs.sentry.io\u002Fproduct\u002Fexplore\u002Fdiscover-queries\u002F) — custom event analytics\n- [Webhooks Integration](https:\u002F\u002Fdocs.sentry.io\u002Forganization\u002Fintegrations\u002Fintegration-platform\u002Fwebhooks\u002F) — outbound event webhooks\n- [PagerDuty Integration](https:\u002F\u002Fdocs.sentry.io\u002Forganization\u002Fintegrations\u002Fnotification-incidents\u002Fpagerduty\u002F) — incident routing\n- [Slack Integration](https:\u002F\u002Fdocs.sentry.io\u002Forganization\u002Fintegrations\u002Fnotification-incidents\u002Fslack\u002F) — alert channels\n\n## Next Steps\n\n- Configure sentry-performance-tracing for transaction-level instrumentation\n- Set up sentry-release-management to correlate deploys with error regressions\n- Add sentry-ci-integration to catch regressions before they reach production\n- Review sentry-cost-tuning to manage event volume as observability coverage expands\n",{"name":5,"tags":24,"author":33,"license":15,"version":34,"description":35,"allowed-tools":36,"compatible-with":37},[25,26,27,28,29,30,31,32],"saas","sentry","observability","logging","metrics","apm","grafana","opentelemetry","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Integrate Sentry with your observability stack — logging, metrics, APM, and dashboards.\nUse when connecting Sentry to winston\u002Fpino\u002Fstructlog, correlating errors with business\nmetrics, deciding between Sentry performance and Datadog\u002FNew Relic, building Sentry\nDiscover dashboards, or linking events to external tools via extra context.\nTrigger: \"sentry observability\", \"sentry logging\", \"sentry metrics\", \"sentry grafana\",\n\"sentry datadog correlation\", \"sentry discover dashboard\".\n","Read, Write, Edit, Grep, Bash(node:*), Bash(npx:*), Bash(pip:*)","claude-code, codex, openclaw","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Fsaas-packs--sentry-pack--sentry-observability",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill sentry-observability",{"tool":53,"command":54},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill sentry-observability",{"tool":56,"command":57},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill sentry-observability","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--sentry-pack--sentry-observability\u002FSKILL.md",true,[],[62,69,76,83,90,98],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":94,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]