-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Is your feature request related to a problem? Please describe.
The LogEventMapper (https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/log4j/log4j-appender-2.17/library/src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/internal/LogEventMapper.java) lacks of config flexibility. We should be able to specify a simple mapping for fields, at least for context attributes.
Describe the solution you'd like
As a first step, remove the hard-coded prefix 'log4j.context_data.' added to all ThreadContext attributes.
We should be able to configure this prefix.
Then using a kind of mapping using regexp for example would be nice.
Describe alternatives you've considered
So far as a workaround, I'm using transformer in the collector to remap those attributes. But this requires a set and a delete for each key and thus requires to know all the used attributes.