You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/container-apps/java-metrics-with-grafana.md
+18-22Lines changed: 18 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,14 @@ author: craigshoemaker
6
6
ms.service: azure-container-apps
7
7
ms.custom: devx-track-extended-java
8
8
ms.topic: tutorial
9
-
ms.date: 12/18/2024
9
+
ms.date: 03/25/2026
10
10
ms.author: cshoe
11
11
#customer intent: As a developer, I want to build a grafa dashboard for Java metrics exposed from Azure Container Apps
12
12
---
13
13
14
14
# Tutorial: Build a Java metrics dashboard with Azure Managed Grafana
15
15
16
-
In this tutorial, you will learn how to set up a metrics dashboard using Azure Managed Grafana to monitor Java applications running in Azure Container Apps.
16
+
In this tutorial, you learn how to set up a metrics dashboard using Azure Managed Grafana to monitor Java applications running in Azure Container Apps.
17
17
18
18
Grafana is a popular tool for centralized metrics visualization and monitoring in the observability industry. Azure Managed Grafana is a fully managed Azure service that allows you to deploy and manage Grafana dashboards with seamless Azure integration. You can use Azure Managed Grafana to visualize Java metrics exposed by Azure Container Apps or integrate Java metrics into your existing Grafana dashboards.
19
19
@@ -25,15 +25,16 @@ In this tutorial, you:
25
25
26
26
## Prerequisites
27
27
28
-
* An Azure account with an active subscription. If you don't already have one, you can [can create one for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
29
-
*[Azure CLI](/cli/azure/install-azure-cli).
30
-
*[A Java application deployed in Azure Container Apps](java-get-started.md).
28
+
- An Azure account with an active subscription. If you don't already have one, you can [can create one for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
29
+
-[Azure CLI](/cli/azure/install-azure-cli).
30
+
-[A Java application deployed in Azure Container Apps](java-get-started.md).
31
31
32
32
## Set up the environment
33
33
34
34
Use the following steps to define environment variables and ensure your Azure Managed Grafana extension is up to date.
35
35
36
36
1. Create variables to support your Grafana configuration.
37
+
37
38
```bash
38
39
export LOCATION=eastus
39
40
export SUBSCRIPTION_ID={subscription-id}
@@ -44,12 +45,11 @@ Use the following steps to define environment variables and ensure your Azure Ma
|`LOCATION`| The Azure region location where you create your Azure Managed Grafana instance. |
47
-
|`SUBSCRIPTION_ID`| The subscription ID which you use to create your Azure Container Apps and Azure Managed Grafana instance. |
48
+
|`SUBSCRIPTION_ID`| The subscription ID, which you use to create your Azure Container Apps and Azure Managed Grafana instance. |
48
49
|`RESOURCE_GROUP`| The Azure resource group name for your Azure Managed Grafana instance. |
49
50
|`GRAFANA_INSTANCE_NAME`| The instance name for your Azure Managed Grafana instance. |
50
-
51
-
52
-
1. Log in to Azure with the Azure CLI.
51
+
52
+
1. Sign in to Azure with the Azure CLI.
53
53
54
54
```azurecli
55
55
az login
@@ -63,10 +63,9 @@ Use the following steps to define environment variables and ensure your Azure Ma
63
63
64
64
1. Use the following command to ensure that you have the latest version of the Azure CLI extensions for Azure Managed Grafana.
65
65
66
-
```azurecli
67
-
az extension add --name amg --upgrade
68
-
```
69
-
66
+
```azurecli
67
+
az extension add --name amg --upgrade
68
+
```
70
69
71
70
## Set up an Azure Managed Grafana instance
72
71
@@ -81,7 +80,7 @@ First, create an Azure Managed Grafana instance, and grant necessary role assign
81
80
--location $LOCATION
82
81
```
83
82
84
-
1.Grant the Azure Managed Grafana instance "Monitoring Reader" role to read metrics from Azure Monitor. Find more about the[authentication and permissions for Azure Managed Grafana](../managed-grafana/how-to-authentication-permissions.md).
83
+
1.To read metrics from Azure Monitor, you need to grant the Azure Managed Grafana instance a *Monitoring Reader* role. To find out more, see[authentication and permissions for Azure Managed Grafana](../managed-grafana/how-to-authentication-permissions.md).
@@ -94,7 +93,6 @@ First, create an Azure Managed Grafana instance, and grant necessary role assign
94
93
> [!IMPORTANT]
95
94
> To add a new dashboard in Grafana, you need to have `Grafana Admin` or `Grafana Editor`role, see [Azure Managed Grafana roles](../managed-grafana/concept-role-based-access-control.md).
96
95
97
-
98
96
1. Assign the `Grafana Admin` role to your account on the Azure Managed Grafana resource.
99
97
100
98
Get the resource ID for your Azure Managed Grafana instance.
@@ -121,20 +119,20 @@ First, create an Azure Managed Grafana instance, and grant necessary role assign
121
119
--query "properties.endpoint" \
122
120
--output tsv
123
121
```
124
-
This command returns the URL you can use to access the Azure Managed Grafana dashboard. Open your browser with URL and login.
122
+
This command returns the URL you can use to access the Azure Managed Grafana dashboard. Open your browser with the URL and sign in.
125
123
126
-
1. Go to `Dashboard` > `New` -> `Import`. Upload the above sample dashboard JSON file, and choose the default built-in `Azure Monitor` data source, then click`Import` button.
124
+
1. Go to `Dashboard` > `New` -> `Import` and upload the sample dashboard JSON file that you downloaded in the previous step. Choose the default built-in `Azure Monitor` data source, then select the`Import` button.
127
125
128
126
:::image type="content" source="media/java-metrics-with-grafana/import-java-dashboard.png" alt-text="Screenshot of importing Java metric dashboard for Azure Container Apps." lightbox="media/java-metrics-with-grafana/import-java-dashboard.png":::
129
127
130
-
131
128
## Visualize Java metrics for Azure Container Apps with Grafana
132
129
133
-
1. Input your resource information in the filters for your Azure Container Apps. Now you can view all the [supported Java metrics in Azure Container Apps](java-metrics.md) within the dashboard. The sample dashboard provides live metric data, including
130
+
1. Input your resource information in the filters for your Azure Container Apps. Now you can view all the [supported Java Virtual Machine (JVM) metrics in Azure Container Apps](java-metrics.md) within the dashboard. The sample dashboard provides live metric data, including
131
+
134
132
- Container App Overview
135
133
- JVM Memory Usage
136
134
- JVM Memory Buffer
137
-
- JVM GC JVM GC
135
+
- JVM garbage collection (GC)
138
136
- A detailed JVM Memory Usage Analysis
139
137
140
138
:::image type="content" source="media/java-metrics-with-grafana/grafana-overview.png" alt-text="Screenshot of Overview tab in Grafana." lightbox="media/java-metrics-with-grafana/grafana-overview.png":::
@@ -147,10 +145,8 @@ First, create an Azure Managed Grafana instance, and grant necessary role assign
147
145
148
146
:::image type="content" source="media/java-metrics-with-grafana/grafana-jvm-memory-analysis.png" alt-text="Screenshot of JVM memory analysis tab in Grafana." lightbox="media/java-metrics-with-grafana/grafana-jvm-memory-analysis.png":::
149
147
150
-
151
148
You can use this dashboard as a starting point to create your own customized metric visualizations and monitoring solution.
152
149
153
-
154
150
## Clean up resources
155
151
156
152
The resources created in this tutorial have an effect on your Azure bill. If you aren't going to use these services long-term, run the following command to remove everything created in this tutorial.
0 commit comments