Commit e4a4cdc
authored
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 -->1 parent 629bc39 commit e4a4cdc
File tree
9 files changed
+408
-535
lines changed- sdk/@launchdarkly/observability-android/lib/src
- main/kotlin/com/launchdarkly/observability
- client
- sampling
- test/kotlin/com/launchdarkly/observability
- client
- sampling
9 files changed
+408
-535
lines changedLines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
Lines changed: 22 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
419 | 418 | | |
420 | 419 | | |
421 | 420 | | |
422 | 421 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
432 | 442 | | |
433 | 443 | | |
434 | 444 | | |
| |||
449 | 459 | | |
450 | 460 | | |
451 | 461 | | |
452 | | - | |
453 | 462 | | |
454 | 463 | | |
455 | 464 | | |
456 | 465 | | |
457 | | - | |
| 466 | + | |
458 | 467 | | |
459 | 468 | | |
460 | 469 | | |
| |||
465 | 474 | | |
466 | 475 | | |
467 | 476 | | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | 477 | | |
477 | 478 | | |
478 | 479 | | |
| |||
Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments