Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Update the DSC's sample-rate #117

@cleptric

Description

@cleptric

Description

As required by Relay and the EAP, the sample_rate in the DSC must specify the actual sample rate of the trace. If an SDK overrides the sample rate of an incoming trace, for example by invoking the tracesSampler, the new rate must be set on the DSC.
Note that usually the DSC is supposed to be immutable, which includes the sample rate, to ensure complete traces. Invoking the tracesSampler purposefully opts out of this and modifies the DSC.

Implementation

On an incoming trace, the DSC's sample_rate is updated if:

  • an explicit sampling decision is forced, e.g. startTransaction(sampled: true)
  • the tracesSampler is invoked
  • the tracesSampleRate is used
  • the SDK downsamples due to backpressure

Stakeholder(s)

@jan-auer

Team(s)

Mobile, Web Backend, Web Frontend, GDX

SDKs

## SDKs
- [x] JavaScript SDK (https://github.com/getsentry/sentry-javascript/pull/15024)
- [x] Python SDK (https://github.com/getsentry/sentry-python/issues/3999)
- [x] Apple/Cocoa SDK as Cocoa doesn't support incoming traces
- [x] Dart/Flutter SDK doesn't support incoming traces
- [x] Java / Android SDK (https://github.com/getsentry/sentry-java/issues/4116)
- [x] Kotlin Multiplatform SDK depends on native SDKs
- [x] Go SDK https://github.com/getsentry/sentry-go/issues/989
- [ ] React Native SDK (by JS v9 upgrade) https://github.com/getsentry/sentry-react-native/issues/4540
- [ ] Native SDK
- [ ] Electron SDK
- [ ] PHP SDK
- [ ] Laravel SDK
- [ ] Symfony SDK
- [ ] Ruby SDK
- [ ] Elixir SDK
- [ ] Rust SDK
- [ ] .NET SDK
- [ ] Unity SDK
- [ ] Unreal SDK
- [ ] PowerShell SDK
- [ ] Capacitor SDK
- [ ] Cordova SDK
- [ ] Sentry CLI

Sub-issues

Metadata

Metadata

Assignees

Projects

Status

Needs Discussion

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions