Skip to content
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

Configuration file passed as argument is ignored in 1.21 #7540

Closed
gh-axel-czarniak opened this issue Jan 10, 2023 · 3 comments · Fixed by #7550
Closed

Configuration file passed as argument is ignored in 1.21 #7540

gh-axel-czarniak opened this issue Jan 10, 2023 · 3 comments · Fixed by #7550
Labels
bug Something isn't working

Comments

@gh-axel-czarniak
Copy link

Describe the bug
When laughing a Java application with opentelemetry 1.21 and a configuration file passed as argument (-Dotel.javaagent.configuration-file), the configuration file is ignored and properties are not loaded in the agent.

In our case, we have done some test using the debug log and a configuration file with these information:

otel.javaagent.enabled=false
otel.metrics.exporter=none
otel.logs.exporter=none

In this case the agent start the instrumentation and send trace to the collector.

If we use environment variable to disable the agent it works fine.

Steps to reproduce
Launch a Java with the java auto instrumentation agent in version 1.21 with a configuration file as property.

What did you expect to see?
The agent is loaded but does not instrument the code and does not send trace to the collector.

What did you see instead?
The agent is loaded and instrument the code and send trace to the collector.

What version are you using?
1.21.0

Environment
Compiler: OpenJDK 17.0
OS: Debian

Tell me if you need additional information or some logs.

Thanks

@gh-axel-czarniak gh-axel-czarniak added the bug Something isn't working label Jan 10, 2023
@mateuszrzeszutek
Copy link
Member

Hey @axelczk ,

otel.javaagent.enabled is one of these few configuration settings that actually don't work with the configuration file - the reason for that is that when this property is checked, the configuration file is not even loaded.

In this case the agent start the instrumentation and send trace to the collector.

You could set otel.traces.exporter = none or otel.sdk.disabled = true to turn off the tracing instead.

@gh-axel-czarniak
Copy link
Author

Hi @mateuszrzeszutek,

We have few old services using the otel 1.16 release and it works with the configuration file. I didn't see any breaking change announcement in the different release note between the 1.16 and the 1.21. Is there anything that can explain this change ?

@mateuszrzeszutek
Copy link
Member

Yeah, we did not really list it in the release notes, must have happened around 1.17/1.18 I think.

It definitely is a breaking change, and it does make things kinda confusing if there are some properties that work with the file and some that don't - I think we should fix that.

trask pushed a commit that referenced this issue Jan 12, 2023
Fixes #7540

I think this kind of early config might be useful in general -- for
instance, I think I'd like to use it for properties introduced in
#7339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants