Azure Application Insights libraries for Java

Overview

Detect, triage, and diagnose issues in your web apps and services with Application Insights.

To get started with Application Insights, see Get started with Application Insights in a Java web project.

Client library

Add telemetry to track events, exceptions, and user metrics in your apps with the Application Insights client library.

Add a dependency to your Maven pom.xml file to use the client library in your project.

<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>applicationinsights-web</artifactId>   
    <version>2.3.1</version>
</dependency>

Example

Create a new metric entry and record a value for it.

    MetricTelemetry sample = new MetricTelemetry();
    sample.setName("metric name");
    sample.setValue(42.3);
    telemetryClient.trackMetric(sample);

Samples

Explore more sample Java code for Application Insights you can use in your apps.