Skip to content

In this project demonstrated implementation of OpenTelemetry auto instrumentation agents to send Logs, Traces and Metrics without making any code changes.

License

Notifications You must be signed in to change notification settings

sanjaydas9027/SpringBootApp-OTel_AutoInstrumentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Application with OTel Auto-Instrumentation

This is a sample application that utilizes OpenTelemetry (OTel) auto-instrumentation to seamlessly collect logs, traces, and metrics, and then send them to a specified endpoint. No code change is required for enabling OpenTelemetry instrumentation.

Installation Steps

Install Docker

Make sure Docker is installed on your system. You can use the following commands for installation:

sudo apt update
sudo apt install docker.io
sudo su -
usermod -aG docker ubuntu

Update Dockerfile

Update the Dockerfile with the necessary environment variables for OTel configuration. You can set the endpoint and, if applicable, provide authentication headers.

ENV OTEL_EXPORTER_OTLP_ENDPOINT="https://otel.kloudmate.com:4318"
ENV OTEL_EXPORTER_OTLP_HEADERS="Authorization=<YOUR_SECRET_KEY>"

# If no authentication is required, use the endpoint only
# ENV OTEL_EXPORTER_OTLP_ENDPOINT="https://webhook.site/ddd1f40d-e3f7-4178-93e2-5f35760feaca"

No code change is required within the application for enabling OpenTelemetry.

Docker Commands

Build the Docker image and run the container with the following commands:

docker build -t <imageName> .
docker run -p 8080:8080 <imageName>:<tag>

Access App

  • The application will be accessible on http://localhost:8080
  • RollDice will be accessible on http://localhost:8080/rolldice
  • To pass Player name use queryparameter ?player=<playername> i.e http://localhost:8080/rolldice?player=sanjay

Screenshots

Project Screenshot Project Screenshot

Logs

Project Screenshot Project Screenshot

Trace

Project Screenshot Project Screenshot

Metrics

Project Screenshot

About

In this project demonstrated implementation of OpenTelemetry auto instrumentation agents to send Logs, Traces and Metrics without making any code changes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published