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/azure-monitor/app/java-jmx-metrics-configuration.md
+19-15Lines changed: 19 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,29 +15,32 @@ Application Insights Java 3.x collects some of the JMX metrics by default, but i
15
15
16
16
## How do I collect additional JMX metrics?
17
17
18
-
JMX metrics collection can be configured by adding a ```"jmxMetrics"``` section to the applicationinsights.json file. You can specify the name of the metric the way you want it to appear in Azure portal in application insights resource. You have to define the object name and attribute for each of the metrics you want collected.
18
+
JMX metrics collection can be configured by adding a ```"jmxMetrics"``` section to the applicationinsights.json file. You can specify the name of the metric the way you want it to appear in Azure portal in application insights resource. Object name and attribute are required for each of the metrics you want collected.
19
19
20
20
## How do I know what metrics are available to configure?
21
21
22
-
You nailed it - you must know the object names and the attributes, those properties are different for various libraries, frameworks, and application servers, and are often not well documented. To get the object names and attributes, you need to view the MBean tree. An MBean is a managed Java object, that can represent a device, an application, or a resource, and has a set of attributes.
22
+
You nailed it - you must know the object names and the attributes, those properties are different for various libraries, frameworks, and application servers, and are often not well documented. Luckily, it's easy to find exactly what JMX metrics are supported for your particular environment.
23
23
24
-
To view the available metrics and browse through the available metrics, we recommend using [Java Mission Control](https://www.oracle.com/java/technologies/jdk-mission-control.html).
24
+
To view the available metrics, set the self-diagnostics level to `DEBUG` in your `applicationinsights.json` configuration file, for example:
25
25
26
-
### How to navigate the Java Mission Control to get to the right metrics?
27
-
28
-
When you run the Java Mission Control tool, you'll have a selection of JVMs available on the left side, click on the relevant process under the 'JVM Browser' tab. Wait until JMC loads the dashboard for the process, select 'MBean Browser' tab on the bottom (see below). The JMC must be located in the same folder as the JVM and your process/app must be up and running.
29
-
30
-

26
+
```json
27
+
{
28
+
"selfDiagnostics": {
29
+
"level": "DEBUG"
30
+
}
31
+
}
32
+
```
31
33
32
-
### How to get to the metrics I want, and the necessary attributes?
34
+
The available JMX metrics, with the object names and attribute names will appear in the application insights log file.
33
35
34
-
The MBean browser opens the MBean tree with the list of categories that can be expanded. Selecting a category on the left opens the list of attributes on the right. Below is an example of a metric, its object name, and the attributes. The attributes may be nested, as in the example below.
36
+
The output in the log file will look similar to the example below. In some cases the list can be quite extensive.
37
+
> [!div class="mx-imgBorder"]
38
+
> 
35
39
36
-

37
40
38
-
###Configuration example
41
+
## Configuration example
39
42
40
-
From the selection as shown in the image above, lets configure a few metrics. The first one is an example of a nested metric - `LastGcInfo` that has several properties, and we want to capture the `GcThreadCount`.
43
+
Knowing what metrics are available, you can configure the agent to collect those. The first one is an example of a nested metric - `LastGcInfo` that has several properties, and we want to capture the `GcThreadCount`.
41
44
42
45
```json
43
46
"jmxMetrics": [
@@ -59,7 +62,7 @@ From the selection as shown in the image above, lets configure a few metrics. Th
59
62
],
60
63
```
61
64
62
-
###Types of collected metrics and available configuration options?
65
+
## Types of collected metrics and available configuration options?
63
66
64
67
We support numeric and boolean JMX metrics, while other types aren't supported and will be ignored.
65
68
@@ -70,4 +73,5 @@ Currently, the wildcards and aggregated attributes aren't supported, that's why
70
73
71
74
As your application is running and the JMX metrics are collected, you can view them by going to Azure portal and navigate to your application insights resource. Under Metrics tab, select the dropdown as shown below to view the metrics.
72
75
73
-

76
+
> [!div class="mx-imgBorder"]
77
+
> 
0 commit comments