Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions skills/sentry-node-sdk/references/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,19 +441,31 @@ Sentry.startSpan(

## `ignoreSpans` — Filtering Spans

Drop specific spans before they are sent. Accepts strings (substring match), RegExp, or functions:
Drop specific spans before they are sent. Accepts strings (substring match), RegExp, functions, or objects with an optional `attributes` field for attribute-based matching:

```typescript
Sentry.init({
ignoreSpans: [
// Drop health check spans
// Drop health check spans (string substring match)
"health",
// Drop spans by name pattern (RegExp)
/health|heartbeat|ping/,
// Drop internal DB keepalive queries
// Drop internal DB keepalive queries (function)
(span) => span.op === "db.query" && span.description?.includes("SELECT 1"),
// Drop spans matching specific attributes (object form, SDK ≥9.x)
{
name: /health/, // optional: name/op substring or RegExp
attributes: {
"http.url": "/health", // string = substring match
"http.status_code": 200, // non-string = strict equality
},
Comment on lines +459 to +461
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The Node SDK documentation incorrectly states the attributes feature in ignoreSpans requires "SDK ≥9.x", while the React SDK documentation correctly states "SDK ≥10.6.0".
Severity: MEDIUM

Suggested Fix

Update the version requirement in the Node SDK documentation at skills/sentry-node-sdk/references/tracing.md from ≥9.x to ≥10.6.0 to match the React SDK documentation and the actual feature release version. This ensures consistency and prevents user confusion.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: skills/sentry-node-sdk/references/tracing.md#L459-L461

Potential issue: The documentation for the Node SDK incorrectly states that the
`attributes` field in the `ignoreSpans` configuration is available in SDK versions
`≥9.x`. However, the corresponding React SDK documentation specifies version `≥10.6.0`.
Since both SDKs share the same underlying `@sentry/core` package where this feature is
implemented, the versions should be consistent. This discrepancy will cause users of the
Node SDK on a version like `9.x` or `10.5.0` to attempt to use a feature that doesn't
exist in their version, leading to silent failure of the span filtering and user
confusion.

Also affects:

  • skills/sentry-react-sdk/references/tracing.md:1268~1271

Did we get this right? 👍 / 👎 to inform future reviews.

},
],
});
```

The `attributes` field on an object entry matches span attributes: string values use substring/RegExp matching, non-string values (numbers, booleans, arrays) use strict equality.

---

## Distributed Tracing
Expand Down
9 changes: 9 additions & 0 deletions skills/sentry-react-sdk/references/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,15 @@ Sentry.init({

// Object — name regex
{ name: /^(hotjar|analytics|gtag)/ },

// Object — filter by span attributes (SDK ≥10.6.0)
// String attribute values use substring/RegExp matching; non-strings use strict equality
{
attributes: {
"url.path": "/health", // substring match
"http.response.status_code": 200, // strict equality
},
},
],
});
```
Expand Down
Loading