-
Notifications
You must be signed in to change notification settings - Fork 871
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
Spring Boot: Error when configuring OTLP exporter in application.properties #10943
Spring Boot: Error when configuring OTLP exporter in application.properties #10943
Comments
Probably fails because the default otlp protocol is |
Are you sure? Because here: https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#otlp-exporter-span-metric-and-log-exporters Edit: That was it, you are right @laurit. I guess the the docs here need to be updated then :
|
The referenced documentation is correct, for |
Hum, I understand what you mean, but I don't think the documentation is right. My flow was:
I think the instructions then need to be modified to alert about the changes in instrumentation 2.0. I couldn't find this anywhere :(. |
That's right - I think this note got lost. |
@zeitlinger can this issue be closed? |
Yes, the docs have been updated here: https://opentelemetry.io/docs/languages/java/automatic/configuration/ |
thanks guys, the doc is a little bit confusing. I've checked for multiple times and still considered java agent jar as using default grpc. |
can you point out what caused (which page) caused the confusion? |
OK, it's a kind of long road. I started from multiple APM platforms and thus found opentelemetry. All of their docs mentioned configs like So I directly went for this page https://opentelemetry.io/docs/zero-code/java/agent/configuration/ as it is labeled as Java Agent. Then I found all things with otel.exporter.otlp at https://opentelemetry.io/docs/languages/java/configuration/. I felt finally released and successfully confirmed that i was surely using the default protocol grpc. This is confusing because java agent does not share the same config with java sdk while there is no noticeable specification on java agent page. Is it clearly described? |
Yes, this is great feedback for our project to improve the docs: open-telemetry/opentelemetry.io#4881 |
Describe the bug
I generated a Spring Boot app from start.spring.io, and followed the steps on the website to add the OTel dependencies (gradle) https://opentelemetry.io/docs/languages/java/automatic/spring-boot/#opentelemetry-spring-boot-starter
I then saw we can use the same SDK configuration inside
application.properties
. So I added:And then when I start the application, I get a lot of errors such as:
But when I configure the OTLP exporter endpoint like this:
It works, and I get the spans in my collector.
Funny thing, is that
otel.service.name
works. If I change that tospring.otel.service.name
then I don't have the service name on the resource.Steps to reproduce
Generate a Spring Boot web app like: https://start.spring.io/#!type=gradle-project&language=java&platformVersion=3.2.4&packaging=jar&jvmVersion=17&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=web
Add the OTel dependencies like in the website https://opentelemetry.io/docs/languages/java/automatic/spring-boot/#dependency-management
Add a
application.properties
containing:Expected behavior
The configuration works with the snippets from the OTel website
Actual behavior
No spans arriving when I use the configuration from the website instructions
Javaagent or library instrumentation version
opentelemetry-bom:1.36.0
opentelemetry-instrumentation-bom-alpha:2.2.0-alpha
Environment
JDK: eclipse-temurin:21-jdk
OS: Linux
Additional context
No response
The text was updated successfully, but these errors were encountered: