Skip to content

digma-ai/otel-sample-app-java

 
 

Repository files navigation

digma-ai

Digma Sample: Java SpringBoot PetClinic Sample

The following code is a sample application used to demonstrate how Digma can help demystify code by providing visibility into code paths, breakdown, identifying performance bottlenecks and runtime errors.

We took the original application of PetClinic and added some common coding anti-patterns that would often be detected in real-world codebases.

Prerequisites

Optional

Running the app with Digma Continuous Feedback

Build the application and run it

  1. Clone this project to your machine and open it in IntelliJ.
  2. Make sure to select 'Gradle Project' when prompted
  3. run the following command in order prepare the environment: ./gradlew bootJar

Install the IDE extension and Digma

1.Install the Digma Plugin . You can also just search for it in the IDE settings Plugins section. 2.Click the 'Digma' icon on the right side of the screen and walk through the two quick setup steps.

There are a few options to run the application.

Notice that feedback will start appearing in the 'Observabiliy' panel below. You may then click a specific endpoint to explore further, more insights and analytics will apear the more you use the application.

Option 1. Use the included Run Configuration

Select the 'petclinic-service' configuration and run or debug it locally. You can either use the 'ClientTester' task to generate some actions or just browse directly to the PetClinic main page.

Option 2. Via docker which includes the App and Collector

Run the application using the included Docker Compose file

docker-compose up --build

Use the application Manually

Browse to Local PetClinic and use the application freely.

View Digma Insights via Plugin

Within few minutes Digma should have collect the traces and analyze them already. Meanwhile you can open the UI of Digma Plugin, by clicking on 'Digma' at the left-bottom corner in the Intellij

image

Now you can browse to class (shortcut Ctrl + N) OwnerController and you should see something like that:

image

where LOCAL is your local environment, and the list contains linkable methods within this class.

as an example for Insights you can click on findOwner method and you should see something like that:

image

About

A sample Spring-based application with Digma + OpenTelemetry java agent

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 61.8%
  • Java 31.0%
  • HTML 4.4%
  • SCSS 2.0%
  • Other 0.8%