Skip to content

chandru-kumar/opentelemetry-annotation-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTelemetry Annotation Demo

This repo shows how to use annotations on method level to create spans and export the traces to see the Distributed tracing for End to End transaction. Uses AspectJ features to create traces for the methods applied with Annotations.

InjectSpan Annotation

Creates new trace spans and makes the span as current span.

InjectSpanToContext Annotation

Adds spans to current context and makes the span as current span.

InjectChildSpanToContext Annotation

Adds spans as child span to current context.

Pre-requisites

  • Docker
  • JAVA 8
  • Maven

To run the demo, switch to the docker directory and run(Windows machine, Haven't tried in MAC or Linux):

docker compose up -d

The demo exposes the following backends:

Run JAVA app to export the traces using Annotations

To run java application, navigate to root of the project and open command prompt to run command:

mvn package

The target folder will be generated upon succesfull build. Run the jar file:

java -jar opentelemetry-annotations-0.0.1-SNAPSHOT-jar-with-dependencies.jar

Traces should be exported to Zipkin, Jaeger and Elastic (Kibana)..

To clean up any docker container from the demo run docker compose down from this directory.

About

OpenTelemetry - Creating Traces Spans using Annotations for non - instrumented code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published