Skip to content

Commit f0fad9b

Browse files
feat(develop): Document options for adding code source information (#15161)
Document options to add code source information to spans in the SDKs. Code source attributes are added to database queries and outgoing HTTP requests.
1 parent 041c014 commit f0fad9b

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

develop-docs/sdk/telemetry/traces/index.mdx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,53 @@ Examples:
156156
`[403, 404]`: don't sample transactions corresponding to requests with status code 403 or 404
157157
`[[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)
158158

159+
### `enableDbQuerySource`
160+
161+
This MUST be a boolean value that defaults to `true`.
162+
163+
The option controls if attributes with code source information are set on database query spans when the query duration exceeds a given threshold.
164+
165+
The following attributes, or a subset thereof, SHOULD be set on database query spans if the threshold is exceeded.
166+
Values for some of the attributes below may be unavailable in some situations for the SDK, and in these cases a subset MAY be provided.
167+
168+
The attributes are described in <Link to="https://getsentry.github.io/sentry-conventions/generated/attributes/code.html">Sentry's Span Convention Documentation</Link>.
169+
170+
- code.file.path
171+
- code.function.name
172+
- code.line.number
173+
174+
### `dbQuerySourceThresholdMs`
175+
176+
A threshold duration, which MUST be a floating point or integer value.
177+
The value specifies, in milliseconds, the duration of a database query before code source information is added.
178+
179+
The default value is platform-dependent and SHOULD balance the overhead of adding the information with its utility for queries that exceed the threshold duration for users of the SDK.
180+
In Python and PHP Laravel, the default threshold is 100 milliseconds.
181+
182+
### `enableHttpRequestSource`
183+
184+
This MUST be a boolean value that defaults to `true`.
185+
186+
The option controls if attributes with code source information are set on outgoing HTTP requests.
187+
When enabled, the attributes SHOULD be attached only when the time to receive the response from sending the request exceeds a given threshold.
188+
189+
The following attributes, or a subset thereof, SHOULD be set if the threshold is exceeded.
190+
Values for some of the attributes below may be unavailable in some situations for the SDK, and in these cases a subset MAY be provided.
191+
192+
The attributes are described in <Link to="https://getsentry.github.io/sentry-conventions/generated/attributes/code.html">Sentry's Span Convention Documentation</Link>.
193+
194+
- code.file.path
195+
- code.function.name
196+
- code.line.number
197+
198+
### `httpRequestSourceThresholdMs`
199+
200+
A threshold duration, which MUST be a floating point or integer value.
201+
The value specifies, in milliseconds, the time between sending an HTTP request and receiving its response, after which code source information is added.
202+
203+
The default value is platform-dependent and SHOULD balance the overhead of adding the information with its utility for request-response cycles that exceed the threshold duration for users of the SDK.
204+
205+
159206
## `Event` Changes
160207

161208
As of writing, transactions are implemented as an extension of the `Event`

0 commit comments

Comments
 (0)