Skip to content

Commit 9a130c1

Browse files
committed
update spec based on attribute changes
1 parent 824a186 commit 9a130c1

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

develop-docs/sdk/telemetry/logs.mdx

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,24 @@ The `log` envelope item payload is a JSON object that represents a Sentry Log. M
2929
"body": "User John has logged in!",
3030
"attributes": {
3131
"sentry.message.template": {
32-
"string_value": "User %s has logged in!"
32+
"value": "User %s has logged in!",
33+
"type": "string"
3334
},
3435
"sentry.message.parameters.0": {
35-
"string_value": "John"
36+
"value": "John",
37+
"type": "string"
3638
},
3739
"sentry.environment": {
38-
"string_value": "production"
40+
"value": "production",
41+
"type": "string"
3942
},
4043
"sentry.release": {
41-
"string_value": "1.0.0"
44+
"value": "1.0.0",
45+
"type": "string"
4246
},
4347
"sentry.trace.parent_span_id": {
44-
"string_value": "b0e6f15b45c36b12"
48+
"value": "b0e6f15b45c36b12",
49+
"type": "string"
4550
}
4651
}
4752
}
@@ -69,24 +74,28 @@ It consists of the following fields:
6974

7075
: **Object, optional**. A dictionary of key-value pairs of arbitrary data attached to the log. Attributes must also declare the type of the value. The following types are supported: `string`, `boolean`, `integer`, `double`.
7176

72-
Note: `intValue` is a string because JSON only recognizes numbers as floating point values.
77+
Note: `type: "integer"` has string values because JSON only recognizes numbers as floating point values.
7378

7479
Example:
7580

7681
```json
7782
{
7883
"attributes": {
79-
"string_item": {
80-
"stringValue": "value"
84+
"db.namespace": {
85+
"value": "projects",
86+
"type": "string"
8187
},
82-
"integer_item": {
83-
"intValue": "123"
88+
"db.response.returned_rows": {
89+
"value": "123",
90+
"type": "integer"
8491
},
85-
"boolean_item": {
86-
"boolValue": true
92+
"db_query_processing_time": {
93+
"value": 123.456,
94+
"type": "double"
8795
},
88-
"double_item": {
89-
"doubleValue": 123.456
96+
"is_production_db": {
97+
"value": false,
98+
"type": "boolean"
9099
}
91100
}
92101
}
@@ -136,7 +145,7 @@ The SDKs need to expose the following two configuration options:
136145

137146
```js
138147
Sentry.init({
139-
enableSentryLogs: true,
148+
enableLogs: true,
140149

141150
beforeSendLog(log) {
142151
// Prevent logs from being sent to Sentry if the plan type is enterprise
@@ -280,9 +289,9 @@ Beyond these attributes, we are exploring if the SDK should also send OS, user,
280289

281290
### SDK Integrations
282291

283-
SDKs should aim to have it so that console/logger integrations create logs as per the appropriate log level if `enableSentryLogs` is set to true. Examples of this include JavaScript's `console` methods and Pythons `logging` standard library.
292+
SDKs should aim to have it so that console/logger integrations create logs as per the appropriate log level if `enableLogs` is set to true. Examples of this include JavaScript's `console` object and Pythons `logging` standard library.
284293

285-
If SDK authors feel the need, they can also introduce additional options to beyond `enableSentryLogs` to gate this functionality. For example an option to control log appenders added via external config like with `Log4j` in the Java SDK.
294+
If SDK authors feel the need, they can also introduce additional options to beyond `enableLogs` to gate this functionality. For example an option to control log appenders added via external config like with `Log4j` in the Java SDK.
286295

287296
## Appendix A: `otel_log` Envelope Item Payload
288297

0 commit comments

Comments
 (0)