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-630 - Sampling and conditional logic for LOGS moved from exporters to processors (#288)
## Summary
To avoid buffering logs that should be discarded due to the sampling
config, the stop sampling logs in the exporter to do it in the
processors.
"Conditional logic" refers to the logic that was inside the
ConditionLogRecordExporter (Used to allow different filtering rules for
crashes vs normal logs)
## How did you test this change?
Unit tests
## Are there any deployment considerations?
No
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Replaces exporter-based log sampling and crash/normal filtering with
processor-based equivalents and updates the log pipeline and tests
accordingly.
>
> - **Logs pipeline**:
> - Introduces `ConditionalLogRecordProcessor` to filter crash
(`io.opentelemetry.crash`) vs normal logs.
> - Introduces `SamplingLogProcessor` to apply sampling before
downstream processing.
> - Removes exporter wrappers `ConditionalLogRecordExporter` and
`SamplingLogExporter`.
> - Updates `InstrumentationManager.createLoggerProcessor` to chain
`SamplingLogProcessor` → `ConditionalLogRecordProcessor` →
`RoutingLogRecordProcessor`, and simplifies `createLogExporter` to only
build a composite in debug mode.
> - **Tests**:
> - Adds unit tests for `ConditionalLogRecordProcessor` and
`SamplingLogProcessor`.
> - Removes tests for deleted exporter classes.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2067fb3. 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/ConditionalLogRecordExporter.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/SamplingLogExporter.kt
0 commit comments