Skip to content

Implement new telemetry architecture #1077

@giortzisg

Description

@giortzisg

Summary

Implement a priority-based telemetry buffer system for the Go SDK. The main drive behind the change is the prioritization of telemetry types to improve performance and reduce discarding of critical events. For more details see the architecture document here: https://develop.sentry.dev/sdk/miscellaneous/telemetry-buffer/

Architecture Overview

1. TelemetryBuffer

Standalone component that manages event buffering:

  • Routes events to category-specific ring buffers based on event type
  • Performs early rate limiting to avoid buffering when already rate limited

2. Ring Buffers (Per Category)

Fixed-capacity buffers for each event category

3. EnvelopeScheduler

Weighted round-robin scheduler that:

  • Processes buffers by priority: Critical(5) > High(4) > Medium(3) > Low(2) > Lowest(1)
  • Creates multi-item envelopes by batching events of the same category.
  • Performs final rate limiting check before sending
  • Sends Envelopes to Transport

4. NEW Transport Interface

The current HttpTransport implementation includes the batching logic for Sending Events. The transport should actually receive the envelope and just do the http request. The first step for this change would be to include a SendEnvelope method

Data Flow

Event → Client.CaptureEvent() 
      → TelemetryBuffer.BufferEvent()
      → RingBuffer.Offer() 
      → EnvelopeScheduler (weighted round-robin)
      → Build multi-item envelope
      → Transport.SendEnvelope()
      → HTTP Request

Sub-issues

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions