Skip to content

chalb500/obi-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zero-Code Telemetry with OpenTelemetry

A demo project showing how to add distributed tracing to a Java/Spring Boot API using the OpenTelemetry Java agent — no changes to application source code required.

Architecture

React Frontend (port 80)
        ↓
Spring Boot API (port 8080)
        ↓  OTLP/HTTP :4318
OTel Collector (ports 4317, 4318)
        ↓  OTLP/gRPC :4317
Jaeger (port 16686)
Service Description
obi-test-app React + TypeScript frontend
obi-test-api Spring Boot 3 REST API
otel-collector OpenTelemetry Collector — receives and forwards telemetry
jaeger Trace storage and UI

Running the Project

docker compose up --build
URL Description
http://localhost React frontend
http://localhost:8080 Spring Boot API
http://localhost:16686 Jaeger UI

Generating Traces

Hit any API endpoint to produce traces, then search for obi-test-api in the Jaeger service dropdown.

Successful requests:

curl http://localhost:8080/users
curl http://localhost:8080/posts
curl http://localhost:8080/posts/1

Error scenario (triggers a NoSuchElementException, visible as a red span in Jaeger):

curl http://localhost:8080/posts/999

How It Works

The OTel Java agent JAR is downloaded at Docker build time and attached to the JVM via -javaagent. No code changes are needed in the Spring Boot application — the agent instruments HTTP requests, responses, and exceptions automatically.

The agent is configured entirely through environment variables in docker-compose.yml:

OTEL_SERVICE_NAME=obi-test-api
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318

About

Application for testing out OBI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

No contributors