Skip to content

Application Insights for Java Applications in Azure Containers. We needed fine-grained metrics (1s), which is not offered by Azure out of the box. When pointing the JVM to this original JAR live metrics are shown on the Azure dashboard. With this modified version, it is possible to write these metrics simultaneously to a CSV in Azure Fiile Shares.

License

Notifications You must be signed in to change notification settings

daanvinken/ApplicationInsights-Java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Application Insights for Java - Modification for saving azure metrics

In order to enable the metrics for a Java application, one has to point the JVM to an additional Jar file which sends metrics to the dashboard. It does this by default without any modifications. One can then see the metrics on the Azure live metrics dashboard. Now as these metrics are not stored anywhere, we had to modify this open-source instrumentation Jar, such that it stores these fine-grained metrics. We decided to go with Azure File Shares to store these metrics as CSVs.

Main magic happens here. Unfortunately you still have to enter your Azure File Share credentials manually in storageConnectionString.

Application Insights for Java

See documentation at https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-in-process-agent.

Log4j 2 questions?

See response to CVE-2021-44228 Apache Log4j 2.

If you need to build locally

Download the main repo and submodule:

git clone https://github.com/microsoft/ApplicationInsights-Java
cd ApplicationInsights-Java
git submodule init
git submodule update

Publish all the artifacts from the submodule to your local maven repository:

cd otel
./gradlew publishToMavenLocal
cd ..

Build the agent jar file:

./gradlew -DskipWinNative=true :agent:agent:shadowJar

The agent jar file should now be available under agent/agent/build/libs.

If you are contributing...

We follow the same style guidelines and recommended Intellij setup as the OpenTelemetry Java Instrumentation repo.

While developing, if you find errorprone is getting in your way (e.g. it won't let you add System.out.println to your code), you can disable it by adding the following to your ~/.gradle/gradle.properties:

disableErrorProne=true

Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

About

Application Insights for Java Applications in Azure Containers. We needed fine-grained metrics (1s), which is not offered by Azure out of the box. When pointing the JVM to this original JAR live metrics are shown on the Azure dashboard. With this modified version, it is possible to write these metrics simultaneously to a CSV in Azure Fiile Shares.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 94.5%
  • PowerShell 2.2%
  • Kotlin 2.2%
  • C++ 0.7%
  • Batchfile 0.2%
  • Dockerfile 0.1%
  • Other 0.1%