Code Monkey home page Code Monkey logo

otel-demo-app-java's Introduction

Tanzu Observability OTel demo app

This is a sample application using Spring Boot with Jersey called beachshirts, which makes shirts for the beach.

Running the application

  1. git clone this repo and navigate to this dir:

    git clone https://github.com/wavefrontHQ/otel-demo-app-java
    cd otel-demo-app-java
  2. Run mvn clean install from the root directory of the project.

  3. Using the following commands from the root directory, run all the services:

    java -jar ./shopping/target/shopping-1.0-SNAPSHOT.jar
    java -jar ./styling/target/styling-1.0-SNAPSHOT.jar
    java -jar ./delivery/target/delivery-1.0-SNAPSHOT.jar
  4. View the shopping menus:

    curl http://localhost:50050/shop/menu
  5. Order shirts using HTTP POST request:

    curl http://localhost:50050/shop/order -d '{"styleName": "testStyle1", "quantity": 5}'
    • You can use ./loadgen.sh [interval] in the root directory to send a request ordering random shirts every interval seconds (defaults to every 1 second)

Adding OpenTelemetry auto-instrumentation

  1. Download the OpenTelemetry Java Agent:

    curl -Lo /tmp/opentelemetry-javaagent.jar https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
  2. Run the services, attaching the agent:

    JAVA_AGENT=/tmp/opentelemetry-javaagent.jar
    java -jar -javaagent:$JAVA_AGENT ./shopping/target/shopping-1.0-SNAPSHOT.jar
    java -jar -javaagent:$JAVA_AGENT ./styling/target/styling-1.0-SNAPSHOT.jar
    java -jar -javaagent:$JAVA_AGENT ./delivery/target/delivery-1.0-SNAPSHOT.jar
  3. Run the OpenTelemetry Collector with the tanzuobservability exporter configured to point at your wavefront-proxy.

  4. Run the wavefront-proxy with a token and server pointing to your Tanzu Observability endpoint.

  5. Order some shirts and see traces appear in the Tanzu Observability UI.

otel-demo-app-java's People

Contributors

lwluc avatar oppegard avatar sushantdewan123 avatar thepeterstone 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.