Skip to content

This repository shows how to include spring boot with otel

Notifications You must be signed in to change notification settings

saefty/otel-spring-boot-example

Repository files navigation

Scope

This repo includes the AWS Open Telemetry Agent for logging and monitoring the application.

Issues

  • When using logback, the MDC context is set and logged properly.
  • When using log4j2, there is no MDC context being set, nor is there the possibility to log the trace ids.

How to use this project for reproducing the issue

The otel agent can be changed in the dedicated *-build.gradle file. The native otel agent aswell aas the aws otel agent are included into this repository.

bootRun {
	jvmArgs("-javaagent:" + project.rootDir.path + "/aws-opentelemetry-agent.jar")
}

Logback Test

cp build-logback.gradle build.gradle
./gradlew bootRun -Djavaagent:/Users/saeftaher/Downloads/demo/src/aws-opentelemetry-agent.jar
./gradlew bootRun

Log4j Test

cp build-log4j2.gradle build.gradle
./gradlew bootRun

curl localhost:8080 -vvv

About

This repository shows how to include spring boot with otel

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages