Skip to content

Commit 21b4940

Browse files
committed
Add severity-based and trace-based log record processors
1 parent 2640cab commit 21b4940

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

specification/logs/sdk.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ weight: 3
3636
* [Built-in processors](#built-in-processors)
3737
+ [Simple processor](#simple-processor)
3838
+ [Batching processor](#batching-processor)
39+
+ [Severity based processor](#severity-based-processor)
40+
+ [Trace based processor](#trace-based-processor)
3941
- [LogRecordExporter](#logrecordexporter)
4042
* [LogRecordExporter operations](#logrecordexporter-operations)
4143
+ [Export](#export)
@@ -456,6 +458,9 @@ make the flush timeout configurable.
456458
The standard OpenTelemetry SDK MUST implement both simple and batch processors,
457459
as described below.
458460

461+
**Status**: [Development](../document-status.md) - The SDK SHOULD implement
462+
severity based and trace based processors, as described below.
463+
459464
Other common processing scenarios SHOULD be first considered
460465
for implementation out-of-process
461466
in [OpenTelemetry Collector](../overview.md#collector).
@@ -495,6 +500,39 @@ to make sure that they are not invoked concurrently.
495500
* `maxExportBatchSize` - the maximum batch size of every export. It must be
496501
smaller or equal to `maxQueueSize`. The default value is `512`.
497502

503+
#### Severity based processor
504+
505+
**Status**: [Development](../document-status.md)
506+
507+
This is an implementation of `LogRecordProcessor` that filters log records based
508+
on minimum severity level and delegates to a downstream processor.
509+
510+
Only log records with severity greater than or equal to the configured minimum
511+
are forwarded to the delegate processor.
512+
513+
**Configurable parameters:**
514+
515+
* `minimumSeverity` - the minimum severity level required for passing the
516+
log record on to the delegate.
517+
* `delegate` - the processor to delegate to for log records that are not
518+
filtered out.
519+
520+
#### Trace based processor
521+
522+
**Status**: [Development](../document-status.md)
523+
524+
This is an implementation of `LogRecordProcessor` that filters out log records
525+
associated with sampled out spans.
526+
527+
Log records not tied to any span (invalid span context) are not sampled out and
528+
are forwarded to the delegate processor. Log records that are associated with
529+
valid span contexts are only forwarded if the associated span is sampled in.
530+
531+
**Configurable parameters:**
532+
533+
* `delegate` - the processor to delegate to for log records that are not
534+
filtered out.
535+
498536
## LogRecordExporter
499537

500538
`LogRecordExporter` defines the interface that protocol-specific exporters must

0 commit comments

Comments
 (0)