Giter VIP home page Giter VIP logo

micronaut-opentelemetry-agent's Introduction

Auto Instrumentation with OTEL Agent and micronaut

Description

  • This example shows how you can run the MN app with the OTEL agent. (see the run task in the build.gradle.kts file)
  • It also shows how you can pull in the OTEL tracer into your code to create your own spans.
  • It also shows how you can use the OTEL annotations to create spans.

starting mongo locally

docker run -p 27017:27017 mongo

Running the example against jaeger (locally)

  1. start jaeger locally
docker run --name jaeger3 -e COLLECTOR_OTLP_ENABLED=true -p 16686:16686 -p 4317:4317 -p 4318:4318 jaegertracing/all-in-one:1.35
  1. open the jaeger ui at http://localhost:16686/
  2. start the app
./gradlew run
  1. call the app
curl -X GET http://localhost:8080/hello
  1. look in the jaeger ui for the traces

jaeger-ui.png

Running the example against new relic (hosted)

  1. start the app
export OTEL_EXPORTER_OTLP_HEADERS=api-key=your_new_relic_key_here;

./gradlew clean shadowJar downloadOpenTelemetryAgent
export OTEL_SERVICE_NAME=dave;
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.nr-data.net:4317;
export OTEL_LOGS_EXPORTER=otlp;
export OTEL_EXPORTER_OTLP_COMPRESSION=gzip;
java -javaagent:./build/otel/opentelemetry-javaagent-all.jar -jar ./build/libs/micronaut-with-otel-agent-0.1-all.jar
  1. call the app
curl -X GET http://localhost:8080/hello
  1. look in the new relic and find your trace by the traceId returned in the header

newrelic-ui.png

Running the example against new DynaTrace (hosted)

  1. start the app
export "OTEL_EXPORTER_OTLP_HEADERS=Authorization=Api-Token your-dynatrace-api-token-here";
export OTEL_EXPORTER_OTLP_ENDPOINT=https://your-insance-no.live.dynatrace.com;

./gradlew clean shadowJar downloadOpenTelemetryAgent
export OTEL_SERVICE_NAME=dave;
export OTEL_LOGS_EXPORTER=otlp;
export OTEL_EXPORTER_OTLP_COMPRESSION=gzip;
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
java -javaagent:./build/otel/opentelemetry-javaagent-all.jar -jar ./build/libs/micronaut-with-otel-agent-0.1-all.jar
  1. call the app
curl -X GET http://localhost:8080/hello
  1. look in the dynaTrace and find your trace by the traceId returned in the header

micronaut-opentelemetry-agent's People

Contributors

craftyfella avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.