Add an experimental configuration which disables the automatic export… #6342
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What:
Add an experimental configuration which disables the automatic export of scope log kv attributes for OTLP
Why:
Now, the scoped log kv attributes are either not exported at all with IncludeScopes=false or are all exported for OTLP.
There is no way to export the 'scoped log kv attributes' in a controlled manner while it is possible to do it with LogRecord attributes.
'scoped log kv attributes' are fully read-only while the LogRecord attributes can be modified.
Especially, the OTL exporter is failing with the lack of log kv attributes de-duplication.
How to solve it for now:
The client can decide to add the scope log attributes into the LogRecord using the IncludeScopes=true, config 'OTEL_DOTNET_EXPERIMENTAL_OTLP_DISABLE_ADDING_SCOPE_LOG'=1 and uses a custom BaseProcessor to deal with scope log kv attributes of the LogRecord: add only some of them to the LogRecord attributes, perform de-duplication, sanitization,...
Note:
An experimental configuration is used for now until a more solid solution is found/available.