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/logs.mdx
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,7 @@ The `log` envelope item payload is a JSON object that represents a Sentry Log.
40
40
{
41
41
"timestamp": 1544719860.0,
42
42
"trace_id": "5b8efff798038103d269b633813fc60c",
43
+
"span_id": "b0e6f15b45c36b12",
43
44
"level": "info",
44
45
"body": "User John has logged in!",
45
46
"attributes": {
@@ -58,10 +59,6 @@ The `log` envelope item payload is a JSON object that represents a Sentry Log.
58
59
"sentry.release": {
59
60
"value": "1.0.0",
60
61
"type": "string"
61
-
},
62
-
"sentry.trace.parent_span_id": {
63
-
"value": "b0e6f15b45c36b12",
64
-
"type": "string"
65
62
}
66
63
}
67
64
}
@@ -77,6 +74,10 @@ It consists of the following fields:
77
74
78
75
: **String, required**. The trace id of the log. The value should be 16 random bytes encoded as a hex string (32 characters long). The trace id should be grabbed from the current propagation context in the SDK.
79
76
77
+
`span_id`
78
+
79
+
: **String, optional**. The span id of the span that was active when the log was collected. The value should be 8 random bytes encoded as a hex string (16 characters long). The span id should be grabbed from the current active span in the SDK.
80
+
80
81
`level`
81
82
82
83
: **String, required**. The severity level of the log. One of `trace`, `debug`, `info`, `warn`, `error`, `fatal` (in order of lowest to highest).
@@ -274,16 +275,14 @@ By default the SDK should attach the following attributes to a log:
274
275
275
276
1.`sentry.environment`: The environment set in the SDK if defined.
276
277
2.`sentry.release`: The release set in the SDK if defined.
277
-
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.
278
-
4.`sentry.sdk.name`: The name of the SDK that sent the log
279
-
5.`sentry.sdk.version`: The version of the SDK that sent the log
280
-
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.
278
+
3.`sentry.sdk.name`: The name of the SDK that sent the log
279
+
4.`sentry.sdk.version`: The version of the SDK that sent the log
280
+
5.`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.
@@ -411,7 +410,7 @@ If SDK authors feel the need, they can also introduce additional options to beyo
411
410
412
411
#### Tracing
413
412
414
-
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.
413
+
Logs should be associated with traces if possible. If a log is recorded during an active span, the SDK should set the `span_id` property of the log to the span id of the span that was active when the log was collected.
0 commit comments