open-telemetry / opentelemetry.io

The OpenTelemetry website and documentation
https://opentelemetry.io
Creative Commons Attribution 4.0 International
512 stars 1.1k forks source link

Documentation Request: Configuring OpenTelemetry with Spring Boot Micrometer #5023

Open famaridon opened 1 month ago

famaridon commented 1 month ago

Hello,

Currently, I am using the Java Agent method, which is straightforward to set up and I highly recommend it for getting started. However, I've noticed that this approach misses many Observations and metrics that follow the Spring Boot Observability recommendations. When I tried to enable Micrometer instrumentation, I encountered the following issues:

I've observed similar issues with the OpenTelemetry Spring Boot Starter.

So, I believe there is a third way to configure OpenTelemetry with Spring Boot: Spring Boot Native Support for OpenTelemetry protocol

Interestingly, the Spring team is actively working on integrating observability into all Spring modules, such as:

These integrations provide valuable insights about the application.

Request

Can we provide a comprehensive documentation guide that explains how to configure Spring Boot logs, traces, and metrics export to the OpenTelemetry protocol? This would be beneficial for users looking to leverage the full observability capabilities of Spring Boot with OpenTelemetry.

Offer

I am willing to contribute by writing the article if needed.

Thank you for considering this request.

Best regards

svrnm commented 1 month ago

@open-telemetry/java-approvers @open-telemetry/java-instrumentation-approvers please take a look

zeitlinger commented 4 weeks ago

see https://github.com/open-telemetry/opentelemetry-java-instrumentation/discussions/11403

famaridon commented 4 weeks ago

Hello,

I understand your point of view and would like to seek some clarification regarding the spring-boot-starter.

  1. When I run the spring-petclinic application with the opentelemetry-spring-boot-starter configured as explained in the documentation, I only see a few metrics (e.g., nothing related to JDBC). You can see an example of this in the sample repository.

    image

  2. Why is Micrometer disabled by default? I followed the documentation to enable Micrometer, and while I do see metrics.

  3. Micrometer Tracing is not working. How can I configure the starter or Micrometer Tracing to work properly? You can see an example of this in the sample repository.

Note: to run the sample use mvn spring-boot:run -Dspring-boot.run.profiles=opentelemetry,postgres you need otel collector and postgress running locally

Thank you for your assistance.

famaridon commented 2 weeks ago

Should I move this issue to the open-telemetry/opentelemetry-java-instrumentation repository ?

zeitlinger commented 2 weeks ago

I understand your point of view and would like to seek some clarification regarding the spring-boot-starter.

  1. When I run the spring-petclinic application with the opentelemetry-spring-boot-starter configured as explained in the documentation, I only see a few metrics (e.g., nothing related to JDBC).

the spring starer doesn't have as many instrumentations as the agent - this is one example

  1. Why is Micrometer disabled by default? I followed the documentation to enable Micrometer, and while I do see metrics.

because it creates

  1. Micrometer Tracing is not working. How can I configure the starter or Micrometer Tracing to work properly? You can see an example of this in the sample repository.

please report this to the owners of micrometer tracing