You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: develop-docs/sdk/telemetry/traces/index.mdx
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,34 @@ Header Format:
128
128
129
129
The full spec is available in the [W3C Trace Context](https://www.w3.org/TR/trace-context/) specification.
130
130
131
+
### `traceIgnoreStatusCodes`
132
+
133
+
This SHOULD be a collection of integers, denoting HTTP status codes.
134
+
If suitable for the platform, the collection MAY also admit pairs of integers, denoting inclusive HTTP status code ranges.
135
+
136
+
The option applies exclusively to incoming requests, and therefore MUST only be implemented in server SDKs.
137
+
138
+
The SDK MUST honor this option by inspecting the [`http.response.status_code`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/http/#:~:text=1437-,http.response.status_code,-int) attribute on each transaction/root span before it's finished.
139
+
If the value of this attribute matches one of the status codes in `traceIgnoreStatusCodes`, the SDK MUST set the transaction's [sampling decision](https://develop.sentry.dev/sdk/telemetry/traces/#sampling) to `not sampled`.
140
+
141
+
Note that a prerequisite to implement this option is that every HTTP server integration MUST record the [`http.response.status_code`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/http/#:~:text=1437-,http.response.status_code,-int) attribute as defined in the OTEL spec.
142
+
143
+
The SDK MUST emit a debug log denoting why the transaction was dropped.
144
+
If the SDK implements client reports, it MUST record the dropped transaction with the `event_processor` discard reason.
145
+
146
+
This option MUST default to an empty collection if it's introduced in a release with a minor SemVer bump.
147
+
SDKs SHOULD set the default for this option to the following value (or equivalent if the implementation doesn't admit pairs of integers)
148
+
```
149
+
[[301, 303], [305, 399], [401, 404]]
150
+
```
151
+
at the earliest release with a major SemVer bump following its introduction.
152
+
153
+
The rationale for this option and default is to not consume a user's span quota to trace requests that are useless for debugging purposes (and can often be triggered by scanning bots).
154
+
155
+
Examples:
156
+
`[403, 404]`: don't sample transactions corresponding to requests with status code 403 or 404
157
+
`[[300, 399], [401, 404]]`: don't sample transactions corresponding to requests with status codes between 300 and 399 (inclusive) or between 401 and 404 (inclusive)
158
+
131
159
## `Event` Changes
132
160
133
161
As of writing, transactions are implemented as an extension of the `Event`
0 commit comments