Log Record
s passed to log processor OnEmit
is non-mutable #5219
Description
Blocked by:
Description
The specification requires that log processors be provided a LogRecordProcessor
:
OnEmit
[...]
Parameters:
logRecord
- a ReadWriteLogRecord for the emittedLogRecord
.
Our current implementation Defines the Processor
interface as such:
type Processor interface {
// OnEmit is called when a Record is emitted.
//
// OnEmit will be called independent of Enabled. Implementations need to
// validate the arguments themselves before processing.
//
// Implementation should not interrupt the record processing
// if the context is canceled.
//
// All retry logic must be contained in this function. The SDK does not
// implement any retry logic. All errors returned by this function are
// considered unrecoverable and will be reported to a configured error
// Handler.
//
// Before modifying a Record, the implementation must use Record.Clone
// to create a copy that shares no state with the original.
OnEmit(ctx context.Context, record Record) error
/* ... */
}
Any modification made to the record
passed to a processor's OnEmit
method will not be applied to the subsequent processor. The record is not mutable, it does not comply with the specification requirement.
Metadata
Labels
Type
Projects
Status
Done