4

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:

  1. I confirmed that the opentelemetry-spring-boot-starter dependency is added to my project.
  2. Verified that the traces are being exported to the collector.

Questions:

  1. Is there any additional configuration needed to capture method-level traces automatically?
  2. Do I need to use @WithSpan or manual instrumentation even though I want to rely on Zero-code instrumentation?
  3. 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

2
  • Did you find a solution? Commented Aug 4 at 16:26
  • Unfortunately No Commented Aug 12 at 18:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.