-
Notifications
You must be signed in to change notification settings - Fork 882
Failure to disable Resource provider logs. #6772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Oops replied here because I saw that comment before this issue: Let's use this as an issue to track fixing |
@jack-berg I see that the disabled keys option is labeled: |
@jack-berg ahh.... found it The yaml format is restricted to comma separated list. Found it after some debugging and digging: This solves the issue with the SDK attributes: otel:
experimental:
resource:
disabled:
keys: "telemetry.sdk.language,telemetry.sdk.name,telemetry.sdk.version,data_stream.type,SeverityNumber" However, SeverityNumber and data_stream.type are still present in the final log. I assume it's because the functionality removes only "Resources", but in that case how do we remove other unnecessary fields? On a side note, can I log somehow the JSON message to the console for debugging purposes? Since the collector's "debug" exporter doesn't show the literal JSON message in the output. |
I agree. All of our properties go through a maturation cycle where they start as experimental for a period of time before being promoted to stable, with all the strong backwards compatibility guarantees.
SeverityNumber is a top level field in the log data model, so resource attribute configuration has no affect. If you're using the collector, you may be able to remove it with the transformprocessor (haven't confirmed this but its what I would try). I'm not sure what
You may be interested in the collector's fileexporter, which prints the OTLP JSON encoding of messages to files. In |
Closing as there is no more work here. A good idea would be documenting that most yaml properties strictly rely on comma separated list. |
The YAML format you reference isn't defined as part of this repo. I believe its specific to the spring boot autoconfigure module. Maybe @zeitlinger, @jeanbisutti can comment. |
the spring starter does support native lists - if proper support is added here - I simply forgot that one |
Here's the PR to fix this open-telemetry/opentelemetry-java-instrumentation#12434 |
Describe the bug
Failure to disable resource properties from a structured log message.
I want to log only resource attributes I set in the configuration YAML, so I added
Which almost did the job, I still get:

I tried using:
Steps to reproduce
Create a project using Spring Boot Starter and configure otlp export to collector through grpc.
Produce a log message.
Observe the log message in elastic through the elastic exporter.
What did you expect to see?
When specifying
io.opentelemetry.sdk.autoconfigure.internal.EnvironmentResourceProvider
I expected to see onlysince this is what I have set in the application yaml.
What did you see instead?
I saw an additional resource in the structured log message:
Full YAML config:
What version and what artifacts are you using?
How did you reference these artifacts? pom.xml
Environment
Compiler: coretto-21.0.4
OS: Windows 11
Additional context
Just to note:
io.opentelemetry.sdk.autoconfigure.internal.EnvironmentResourceProvider
is not described here: https://opentelemetry.io/docs/languages/java/configuration/#resourceproviderAlso, can you please tell me how can I toggle all the other attributes present in the structured log:

For example, I don't want:
The text was updated successfully, but these errors were encountered: