Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit c1ab40a

Browse files
committed
feat(perf): Add span data conventions
1 parent 596abdd commit c1ab40a

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/docs/sdk/event-payloads/span.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import "./properties/tags.mdx";
3232

3333
: _Optional_. Arbitrary data associated with this Span.
3434

35+
The semantic conventions for the `data` field are described in <Link to="/sdk/performance/span-data-conventions/">Sentry's Span Convention Documentation</Link>.
36+
3537
```json
3638
{
3739
"data": {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: 'Span Data Conventions'
3+
---
4+
5+
The Span Interface specifies a series of _timed_ application events that have a start and end time. Below describes the conventions for the Span interface for the `data` field on the span.
6+
7+
The `data` field on the span is expected to follow [OpenTelemetry's semantic conventions for attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/24de67b3827a4e3ab2515cd8ab62d5bcf837c586/specification/trace/semantic_conventions/README.md) as much as possible.
8+
9+
Keys on the `data` field should be lower-case and use underscores instead of camel-case. There are some exceptions to this, but these exist because of backwards compatability.
10+
11+
Below describes the conventions for the Span interface for the `data` field on the span and how they are currently used by the product.
12+
13+
## Mobile
14+
15+
| Attribute | Type | Description | Examples |
16+
| ----------------------------------------------------------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------- | -------- |
17+
| `blocked_main_thread` | boolean | Whether the main thread was blocked by the span. | `true` |
18+
| `call_stack` | Array<StackFrame> | The most relevant stack frames, that lead to the File I/O span. The stack frame should adhere to the |
19+
| [`StackFrame`](https://develop.sentry.dev/sdk/event-payloads/stacktrace/#frame-attributes) interface. | |
20+
21+
## Browser
22+
23+
| Attribute | Type | Description | Examples |
24+
| ------------------- | ------ | ------------------------------------------ | --------------------- |
25+
| `url` | string | The URL of the resource that was fetched. | `https://example.com` |
26+
| `method` | string | The HTTP method used. | `GET` |
27+
| `type` | string | The type of the resource that was fetched. | `xhr` |
28+
| `Encoded Body Size` | string | The encoded body size of the request. | `123 B` |
29+
| `Decoded Body Size` | string | The decoded body size of the request. | `456 B` |
30+
| `Transfer Size` | string | The transfer size of the request. | `789 B` |

0 commit comments

Comments
 (0)