Skip to content

Commit 36d4d77

Browse files
feat(develop-docs): Add telemetry buffer page
Add the WIP generic page for telemetry buffers and migrate the batch-processor content.
1 parent 5167542 commit 36d4d77

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

develop-docs/sdk/telemetry/logs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ A new data category for logs has been added to Relay, `log_item`. Both the `log`
396396

397397
### Buffering
398398

399-
Logs should be buffered before being sent. SDKs should keep a buffer of logs on the client (so you can have logs from multiple traces in the buffer) that flushes out based on some kind of condition. We recommend to use follow the [batch processor specification outlined](/sdk/telemetry/spans/batch-processor/) in the develop docs, but you should choose the approach that works best for your platform. When starting initial development on the SDK you can choose a simple approach to buffer like flushing logs if the buffer length exceeds 100 items, or if 5 seconds have passed.
399+
Logs should be buffered before being sent. SDKs should keep a buffer of logs on the client (so you can have logs from multiple traces in the buffer) that flushes out based on some kind of condition. We recommend to follow the [telemetry buffer specification outlined](/sdk/telemetry/telemetry-buffer/) in the develop docs, but you should choose the approach that works best for your platform. When starting initial development on the SDK you can choose a simple approach to buffer like flushing logs if the buffer length exceeds 100 items, or if 5 seconds have passed.
400400

401401
SDKS should NOT release logging capabilities to users if a buffering implementation has not been added to their SDK when adding logging APIs.
402402

develop-docs/sdk/telemetry/spans/batch-processor.mdx renamed to develop-docs/sdk/telemetry/telemetry-buffer.mdx

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
title: Batch Processor
2+
title: Telemetry Buffer
3+
redirect_from:
4+
- /sdk/telemetry/spans/batch-processor/
35
---
46

57
<Alert level="warning">
@@ -10,6 +12,32 @@ title: Batch Processor
1012
This document uses key words such as "MUST", "SHOULD", and "MAY" as defined in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt) to indicate requirement levels.
1113
</Alert>
1214

15+
The telemetry buffer sits between the client and the transport, temporarily storing telemetry data such as spans and logs. Its main goal is to efficiently batch data to reduce the number of outgoing HTTP requests and Sentry envelopes. Without buffering, each span or log would trigger its own request, quickly overwhelming our backends.
16+
17+
```mermaid
18+
flowchart LR
19+
Client[Client] -->|capture telemetry data| Buffer[TelemetryBuffer]
20+
Buffer -->|send envelope| Transport[Transport]
21+
```
22+
23+
Because telemetry workloads and platform constraints vary widely, buffer requirements differ across environments. For example, backend SDKs need high throughput and backpressure management to handle large data volumes. Mobile SDKs have lower throughput and don't need to worry much about backpressure, but they do need to minimize data loss in the event of abnormal process termination. Browser and GDX SDKs also have different requirements.
24+
25+
Therefore, we recommend implementing different types of telemetry buffers tailored to the platform's needs. As of Nov 5th, 2025, this page is under development, and we're currently refining the requirements for different platforms:
26+
27+
* [BatchProcessor V0](#batchprocessor-v0): The BatchProcessor V0 outlines the initial requirements, primarily for logs, to avoid sending numerous HTTP requests. This section exists only as a placeholder until we fully spec out the other telemetry buffers.
28+
* [Backend Telemetry Buffer](#backend-telemetry-buffer): To be defined
29+
* [Mobile Telemetry Buffer](#mobile-telemetry-buffer): To be defined
30+
* [Browser Telemetry Buffer](#browser-telemetry-buffer): To be defined
31+
* [GDX Telemetry Buffer](#gdx-telemetry-buffer): To be defined
32+
33+
# Common Requirements
34+
35+
To be defined. Things like common API, client reports, etc.
36+
37+
# BatchProcessor V0
38+
39+
## Overview
40+
1341
The BatchProcessor batches spans and logs into one envelope to reduce the number of HTTP requests. When an SDK implements span streaming or logs, it MUST use a BatchProcessor, which is similar to [OpenTelemetry's Batch Processor](https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/batchprocessor/README.md). The BatchProcessor holds logs and finished spans in memory and batches them together into envelopes. It uses a combination of time and size-based batching. When writing this, the BatchProcessor only handles spans and logs, but an SDK MAY use it for other telemetry data in the future.
1442

1543
## Specification
@@ -95,3 +123,19 @@ Scenario: 1 span added application crashes
95123
And loses the spans in the BatchProcessor
96124
97125
```
126+
127+
# Backend Telemetry Buffer
128+
129+
To be defined
130+
131+
# Mobile Telemetry Buffer
132+
133+
To be defined
134+
135+
# Browser Telemetry Buffer
136+
137+
To be defined
138+
139+
# GDX Telemetry Buffer
140+
141+
To be defined

redirects.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ const developerDocsRedirects = [
7474
source: '/sdk/replays/:path*',
7575
destination: '/sdk/telemetry/replays/:path*',
7676
},
77+
{
78+
source: '/sdk/telemetry/spans/batch-processor/',
79+
destination: '/sdk/telemetry/telemetry-buffer/',
80+
},
7781
{
7882
source: '/sdk/setup-wizards/:path*',
7983
destination: '/sdk/expected-features/setup-wizards/:path*',

0 commit comments

Comments
 (0)