Application Insights Java In-Process Agent in Azure Spring Cloud (Preview)

This document explains how to monitor apps and microservices using the Application Insights Java agent in Azure Spring Cloud.

With this feature you can:

  • Search tracing data with different filters.
  • View dependency map of microservices.
  • Check request performance.
  • Monitor real-time live metrics.
  • Check request failures.
  • Check application metrics.

Application Insights provide many observable perspectives, including:

  • Application map
  • Performance
  • Failures
  • Metrics
  • Live Metrics
  • Availability

Enable Java In-Process Agent for Application Insights

Enable Java In-Process Agent preview feature using the following procedure.

  1. Go to service overview page of your service instance.
  2. Click Application Insights entry under monitoring blade.
  3. Click Enable Application Insights button to enable Application Insights integration.
  4. Select an existing instance of Application Insights or create a new one.
  5. Chick Enable Java in-process agent to enable preview Java in-process agent feature. Here you can also customize sampling rate from 0 to 100.
  6. Click Save to save the change.

Portal

  1. Go to the service | Overview page and select Application Insights in the Monitoring section.
  2. Click Enable Application Insights to enable Application Insights in Azure Spring Cloud.
  3. Click Enable Java in-process agent to enable Java IPA preview feature. When an IPA preview feature is enabled, you can configure one optional sampling rate (default 10.0%).

IPA 0

Using the Application Insights feature

When the Application Insights feature is enabled, you can:

In the left navigation pane, click Application Insights to jump to the Overview page of Application Insights.

  • Click Application Map to see the status of calls between applications.

    IPA 2

  • Click the link between customers-service and petclinic to see more details such as a query from SQL.

  • In the left navigation pane, click Performance to see the performance data of all applications' operations, as well as dependencies and roles.

    IPA 4

  • In the left navigation pane, click Failures to see if something unexpected from your applications.

    IPA 6

  • In the left navigation pane, click Metrics and select the namespace, you will see both Spring Boot metrics and custom metrics, if any.

    IPA 7

  • In the left navigation pane, click Live Metrics to see the real time metrics for different dimensions.

    IPA 8

  • In the left navigation pane, click Availability to monitor the availability and responsiveness of Web apps by creating Availability tests in Application Insights.

    IPA 9

ARM Template

To use the Azure Resource Manager template, copy following content to azuredeploy.json.

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "resources": [
        {
            "type": "Microsoft.AppPlatform/Spring",
            "name": "customize this",
            "apiVersion": "2020-07-01",
            "location": "[resourceGroup().location]",
            "resources": [
                {
                    "type": "monitoringSettings",
                    "apiVersion": "2020-11-01-preview",
                    "name": "default",
                    "properties": {
                        "appInsightsInstrumentationKey": "00000000-0000-0000-0000-000000000000",
                        "appInsightsSamplingRate": 88.0
                    },
                    "dependsOn": [
                        "[resourceId('Microsoft.AppPlatform/Spring', 'customize this')]"
                    ]
                }
            ],
            "properties": {}
        }
    ]
}

CLI

Apply ARM template with the CLI command:

  • For an existing Azure Spring Cloud instance:
az spring-cloud app-insights update [--app-insights/--app-insights-key] "assignedName" [--sampling-rate] "samplingRate" –name "assignedName" –resource-group "resourceGroupName"
  • For a newly created Azure Spring Cloud instance:
az spring-cloud create/update [--app-insights]/[--app-insights-key] "assignedName" --disable-app-insights false --enable-java-agent true --name "assignedName" –resource-group "resourceGroupName"
  • To disable app-insight:
az spring-cloud app-insights update --disable –name "assignedName" –resource-group "resourceGroupName"

See also