You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: O11Y-742 - Replaced ConditionalSpanExporter with SpansSampler (#289)
## Summary
This change simplifies the trace exporting pipeline by moving the
filtering responsibility from the exporter (ConditionalSpanExporter) to
the sampler (SpansSampler), which is the more appropriate place for this
logic.
## How did you test this change?
Unit tests
## Are there any deployment considerations?
No
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Moves span filtering to an OpenTelemetry sampler (`SpansSampler`),
removes `ConditionalSpanExporter`, wires sampler into tracer provider,
and updates sampling utilities and tests.
>
> - **Tracing/Sampling**:
> - **Sampler Integration**: Set tracer provider sampler to new
`SpansSampler` in `InstrumentationManager`, controlling normal vs error
spans via options.
> - **Exporter Pipeline**: Remove `ConditionalSpanExporter` usage;
`createSpanExporter` now directly wraps base exporter with
`SamplingTraceExporter`.
> - **API Adjustments**: Update `spanProcessor` type to `SpanProcessor`.
> - **Sampling Utilities**:
> - Update `sampleSpans` to use `SpanData.spanId`/`parentSpanId` and
adjust cloning to merge attributes.
> - **Tests**:
> - Add `SpansSamplerTest` covering sampling decisions and description.
> - Remove `ConditionalSpanExporterTest`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f634859. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Copy file name to clipboardExpand all lines: sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/client/ConditionalSpanExporter.kt
Copy file name to clipboardExpand all lines: sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/client/InstrumentationManager.kt
Copy file name to clipboardExpand all lines: sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/sampling/SampleSpans.kt
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -20,19 +20,19 @@ fun sampleSpans(
20
20
// The first pass we sample items which are directly impacted by a sampling decision.
21
21
// We also build a map of children spans by parent span id, which allows us to quickly traverse the span tree.
0 commit comments