@@ -8,6 +8,26 @@ title: Span Protocol
88
99The SDK must implement a new "span v2" envelope item, which is used to emit spans to Sentry.
1010
11+ ## Span v2 Envelope Header
12+
13+ The envelope header must contain the same properties as previously with transactions.
14+ There are no special requirements for the Span v2 envelope header.
15+
16+ ``` json
17+ {
18+ "sent_at" : " 2025-02-07T14:16:00Z" ,
19+ "dsn" :
" https://[email protected] /42" ,
20+ "sdk" : {
21+ // ...
22+ },
23+ "trace" : {
24+ // ...
25+ }
26+ }
27+ ```
28+
29+ Also see [ Envelope Headers] ( /sdk/data-model/envelopes/#headers ) .
30+
1131## Span v2 Envelope Item Header
1232
1333The envelope item header must contain the following properties:
@@ -29,7 +49,6 @@ The envelope item payload must contain an `items` array with span one and up to
2949 "items" : [
3050 {
3151 "trace_id" : " 6cf173d587eb48568a9b2e12dcfbea52" ,
32- "parent_span_id" : null ,
3352 "span_id" : " 438f40bd3b4a41ee" ,
3453 "name" : " GET /users" ,
3554 "status" : " ok" ,
@@ -148,11 +167,22 @@ Attributes are stored as key-value pairs where each value is an object with type
148167
149168#### Common Attribute Keys
150169
170+ All attributes mentioned below must be attached to every span being emitted from the SDK, depending on the platform.
171+ Empty attributes must be emitted.
172+
151173| Attribute Key | Type | Description |
152174| ---------------| ------| -------------|
153175| ` sentry.release ` | string | The release version of the application |
154176| ` sentry.environment ` | string | The environment name (e.g., "production", "staging", "development") |
155- | ` sentry.platform ` | string | The platform/language (e.g., "php", "javascript", "python") |
177+ | ` sentry.segment.name ` | string | The segment name (e.g., "GET /users") |
178+ | ` os.name ` | string | The operating system name (e.g., "Linux", "Windows", "macOS") |
179+ | ` browser.name ` | string | The browser name (e.g., "Chrome", "Firefox", "Safari") |
180+ | ` user.id ` | string | The user ID (gated by ` sendDefaultPii ` ) |
181+ | ` user.email ` | string | The user email (gated by ` sendDefaultPii ` ) |
182+ | ` user.ip_address ` | string | The user IP address (gated by ` sendDefaultPii ` ) |
183+ | ` user.username ` | string | The user username (gated by ` sendDefaultPii ` ) |
184+ | ` thread.id ` | string | The thread ID |
185+ | ` thread.name ` | string | The thread name |
156186| ` sentry.sdk.name ` | string | Name of the Sentry SDK (e.g., "sentry.php", "sentry.javascript") |
157187| ` sentry.sdk.version ` | string | Version of the Sentry SDK |
158188
0 commit comments