I am trying to integrate OpenTelemetry with my existing Spring Boot application using the Zero-code instrumentation Spring Boot Starter. I followed the official documentation and configured the following in my application.yml file:
otel:
propagators:
- tracecontext
exporter:
otlp:
traces:
endpoint: 'http://<otel_collector_server>:4319/v1/traces'
protocol: http/protobuf
metrics:
exporter: none
logs:
exporter: none
With this configuration, the application successfully exports traces to the OpenTelemetry Collector, and I can view the traces in the Grafana dashboard.
However, the traces only show high-level information about which endpoints were hit across different services. They do not provide details about:
Which methods were called after hitting an endpoint.
The execution time of those methods.
I want to capture method-level tracing to see which methods were invoked as part of a request and how much time they took.
What I’ve Tried:
- I confirmed that the opentelemetry-spring-boot-starter dependency is added to my project.
- Verified that the traces are being exported to the collector.
Questions:
- Is there any additional configuration needed to capture method-level traces automatically?
- Do I need to use @WithSpan or manual instrumentation even though I want to rely on Zero-code instrumentation?
- Is there a way to enable this through configuration, or do I need to extend the instrumentation explicitly?
Java version: 21
Spring Boot version: 3.3.0
OpenTelemetry Spring Boot Starter version: 2.6.0