open-telemetry / opentelemetry-go

OpenTelemetry Go API and SDK
https://opentelemetry.io/
Apache License 2.0
4.99k stars 1.01k forks source link

sdk/log: Fix ExampleProcessor_redact to clone the record #5559

Closed pellared closed 2 days ago

pellared commented 5 days ago

Towards https://github.com/open-telemetry/opentelemetry-go/issues/5065

Follow our own docs. From Processor.Enabled docs:

Before modifying a Record, the implementation must use Record.Clone to create a copy that shares no state with the original.