Kris Swat
Kris Swat

Reputation: 1016

How to get Spring boot 3 - otel - opentelemetry - collector work?

I am following this open telemetry example, starting from cloning section - The OpenTelemetry Spring Boot starter in action.

  1. git clone https://github.com/spring-projects/spring-petclinic.git

  2. mvn -Pnative spring-boot:build-image -Dspring-boot.build-image.imageName=spring-petclinic-native

  3. created yaml files as mentioned in the article

  4. docker-compose -f docker-compose-otel.yml up ( but before this I manually started postgres in docker desktop, as there seems something wrong)

  5. tested url - http://localhost:8080/vets.html (displays data)

  6. http://localhost:8080/oups gives error - with message "Something happened..."

The oups code is ??

@GetMapping("/oups")
public String triggerException() {
    throw new RuntimeException(
            "Expected: controller used to showcase what " + "happens when an exception is thrown");
    }

The docker compose up starts resources and docker-compose down does print below:

 ✔ Container spring-petclinic-app-1        0.5s 
 ✔ Container spring-petclinic-collector-1  0.4s 
 ! Network spring-petclinic_default        Resource is still in use  

Does the example use mysql or postgres?

Is docker-compose.yml used ? as step 4 is specifically starting otel yaml file

Should I use curl only (or) can I see telemetry data in browser?

Question:

How to get the example working ?

Please help

Note : The post - stackoverflow post is close but the example already has

receivers:
  otlp:
    protocols:
      http:
        endpoint: '0.0.0.0:4318'

so not sure.

Upvotes: 0

Views: 64

Answers (0)

Related Questions