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
feat(logs): Add sentry.replay_id to logs spec (#14838)
resolves
https://linear.app/getsentry/issue/SDK-35/update-develop-docs-to-mention-sentryreplay-id-attribute
Attaching a replay id directly to logs makes it easy for users to go
from log -> replay. It also vastly simplifies querying for logs in the
frontend.
Right now we have only specced attaching replay to client-side logs, but
in the future we can add the functionality that sdks can parse baggage
to grab the `replay_id` and attach the id to logs.
Copy file name to clipboardExpand all lines: develop-docs/sdk/telemetry/logs.mdx
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -275,14 +275,16 @@ By default the SDK should attach the following attributes to a log:
275
275
3.`sentry.trace.parent_span_id`: The span id of the span that was active when the log was collected. This should not be set if there was no active span.
276
276
4.`sentry.sdk.name`: The name of the SDK that sent the log
277
277
5.`sentry.sdk.version`: The version of the SDK that sent the log
278
+
6.`sentry.replay_id`: The replay id of the replay that was active when the log was collected. This should not be set if there was no active replay.
@@ -393,6 +395,16 @@ SDKs should aim to have it so that console/logger integrations create logs as pe
393
395
394
396
If SDK authors feel the need, they can also introduce additional options to beyond `enableLogs`/`enable_logs` to gate this functionality. For example an option to control log appenders added via external config like with `Log4j` in the Java SDK.
395
397
398
+
### Behaviour with other Sentry Telemetry
399
+
400
+
#### Tracing
401
+
402
+
Logs should be associated with traces if possible. If a log is recorded during an active span, the SDK should set the `sentry.trace.parent_span_id` attribute to the span id of the span that was active when the log was collected.
403
+
404
+
#### Replays
405
+
406
+
Logs should be associated with replays if possible. If a log is recorded during an active replay, the SDK should set the `sentry.replay_id` attribute to the replay id of the replay that was active when the log was collected.
407
+
396
408
### Other
397
409
398
410
If `debug` is set to `true` in SDK init, calls to the Sentry logger API should also print to the console with the appropriate log level. This will help debugging logging setups.
0 commit comments