-------------------- ------------------ ------------------
| Client(UI/Browser) | =======> | Front api service | =======> | Customer service |
-------------------- ------------------ ------------------
1. Start the customer service using command: mvn spring-boot:run
2. Start the front api service (reference link given below)
3. Open browser: http://localhost:8080/customerDetails/1 (Remember: start the Front api service first !)
Reference: Front api service
1. Start the customer service
docker network create tracing
docker pull rduttaxebia/otel-demo-customer-service:latest
docker run --name customer-service --network tracing -p 8081:8081 rduttaxebia/otel-demo-customer-service:latest
2. Start the front-api-service using Docker. Reference link is mentioned above.
- Add the following dependencies in pom.xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
- Add/append the following in application.yml
server.port: 8081
spring:
application:
name: customer-service
zipkin:
baseUrl: http://localhost:9411
sleuth:
sampler:
probability: 1.0 # allowed values between 0.0 - 0.1
- Start a zipkin server using Docker (ignore if already started)
docker network create tracing
docker run -d --rm -it --name zipkin --network tracing -p 9411:9411 openzipkin/zipkin:latest
- Restart the service
mvn spring-boot:run
export OTEL_EXPORTER_ZIPKIN_ENDPOINT=http://localhost:9411/api/v2/spans
export OTEL_TRACES_EXPORTER=zipkin
export OTEL_SERVICE_NAME=customer-service
java -javaagent:opentelemetry-javaagent.jar -jar target/*.jar