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
If you're using the *shell* form, add the JVM arg `-javaagent:"path/to/applicationinsights-agent-3.5.1.jar"` somewhere before `-jar`, for example:
40
+
If you're using the *shell* form, add the Java Virtual Machine (JVM) arg `-javaagent:"path/to/applicationinsights-agent-3.5.1.jar"` somewhere before `-jar`, for example:
In this example we have copied the `applicationinsights-agent-3.5.1.jar` and `applicationinsights.json` files from an `agent` folder (you can choose any folder of your machine). These two files have to be in the same folder in the Docker container.
65
+
In this example, you copy the `applicationinsights-agent-3.5.1.jar` and `applicationinsights.json` files from an `agent` folder (you can choose any folder of your machine). These two files have to be in the same folder in the Docker container.
66
66
67
-
### Third-party container images
67
+
### Partner container images
68
68
69
-
If you're using a third-party container image that you can't modify, mount the Application Insights Java agent jar into the container from outside. Set the environment variable for the container
69
+
If you're using a partner container image that you can't modify, mount the Application Insights Java agent jar into the container from outside. Set the environment variable for the container
@@ -75,7 +75,7 @@ For more information, see [Using Azure Monitor Application Insights with Spring
75
75
76
76
## Java Application servers
77
77
78
-
For information on setting up the Application Insights Java agent, see [Enabling Azure Monitor OpenTelemetry for Java](./opentelemetry-enable.md?tabs=java). The following sections provide additional details which may be helpful when configuring the `-javaagent:...` JVM arg on different application servers.
78
+
For information on setting up the Application Insights Java agent, see [Enabling Azure Monitor OpenTelemetry for Java](./opentelemetry-enable.md?tabs=java). The following sections provide details that might be helpful when configuring the `-javaagent:...` JVM arg on different application servers.
79
79
80
80
### Tomcat 8 (Linux)
81
81
@@ -119,7 +119,9 @@ If the file `<tomcat>/bin/setenv.bat` already exists, modify that file and add `
119
119
120
120
Locate the file `<tomcat>/bin/tomcat8w.exe`. Run that executable and add `-javaagent:path/to/applicationinsights-agent-3.5.1.jar` to the `Java Options` under the `Java` tab.
121
121
122
-
### JBoss EAP 7
122
+
### JBoss Enterprise Application Platform 7
123
+
124
+
In Red Hat JBoss Enterprise Application Platform (EAP) 7, you can set up a standalone server or a domain server.
123
125
124
126
#### Standalone server
125
127
@@ -151,7 +153,7 @@ Add `-javaagent:path/to/applicationinsights-agent-3.5.1.jar` to the existing `jv
151
153
...
152
154
```
153
155
154
-
If you're running multiple managed servers on a single host, you'll need to add `applicationinsights.agent.id` to the `system-properties` for each `server`:
156
+
If you're running multiple managed servers on a single host, you need to add `applicationinsights.agent.id` to the `system-properties` for each `server`:
155
157
156
158
```xml
157
159
...
@@ -173,7 +175,7 @@ If you're running multiple managed servers on a single host, you'll need to add
173
175
...
174
176
```
175
177
176
-
The specified `applicationinsights.agent.id` value must be unique. It's used to create a subdirectory under the Application Insights directory. Each JVM process needs its own local Application Insights config and local Application Insights log file. Also, if reporting to the central collector, the `applicationinsights.properties` file is shared by the multiple managed servers, so the specified `applicationinsights.agent.id` is needed to override the `agent.id` setting in that shared file. The `applicationinsights.agent.rollup.id` can be similarly specified in the server's `system-properties` if you need to override the `agent.rollup.id` setting per managed server.
178
+
The specified `applicationinsights.agent.id` value must be unique. You use the value to create a subdirectory under the Application Insights directory. Each JVM process needs its own local Application Insights config and local Application Insights log file. Also, if reporting to the central collector, multiple managed servers share the `applicationinsights.properties` file, so the specified `applicationinsights.agent.id` is needed to override the `agent.id` setting in that shared file. The `applicationinsights.agent.rollup.id` can be similarly specified in the server's `system-properties` if you need to override the `agent.rollup.id` setting per managed server.
177
179
178
180
### Jetty 9
179
181
@@ -203,13 +205,9 @@ Add `-javaagent:path/to/applicationinsights-agent-3.5.1.jar` to the existing `jv
203
205
### WebSphere 8
204
206
205
207
1. Open Management Console.
206
-
1. Go to **Servers** > **WebSphere application servers** > **Application servers**. Choose the appropriate application servers and select:
207
-
208
-
```
209
-
Java and Process Management > Process definition > Java Virtual Machine
210
-
```
208
+
1. Go to **Servers** > **WebSphere application servers** > **Application servers**. Choose the appropriate application servers and select **Java and Process Management** > **Process definition** > **Java Virtual Machine**.
211
209
212
-
1. In `Generic JVM arguments`, add the following JVM argument:
210
+
1. In `Generic JVM arguments`, add the following JVM argument.
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/java-jmx-metrics-configuration.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: How to configure JMX metrics - Azure Monitor application insights for Java
3
-
description: Configure extra JMX metrics collection for Azure Monitor Application Insights Java agent
3
+
description: Configure extra Java Management Extensions (JMX) metrics collection for Azure Monitor Application Insights Java agent.
4
4
ms.topic: conceptual
5
5
ms.date: 12/15/2023
6
6
ms.devlang: java
@@ -10,11 +10,11 @@ ms.reviewer: mmcc
10
10
11
11
# Configuring JMX metrics
12
12
13
-
Application Insights Java 3.x collects some of the JMX metrics by default, but in many cases it isn't enough. This document describes the JMX configuration option in details.
13
+
Application Insights Java 3.x collects some of the Java Management Extensions (JMX) metrics by default, but in many cases it isn't enough. This document describes the JMX configuration option in details.
14
14
15
15
## How do I collect extra JMX metrics?
16
16
17
-
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.
17
+
JMX metrics collection can be configured by adding a ```"jmxMetrics"``` section to the applicationinsights.json file. Enter a name for the metric as 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.
18
18
19
19
## How do I know what metrics are available to configure?
> With _Spring Boot native image applications_, you can use [this project](https://aka.ms/AzMonSpringNative).
14
14
15
-
There are two options for enabling Application Insights Java with Spring Boot: JVM argument and programmatically.
15
+
There are two options for enabling Application Insights Java with Spring Boot: Java Virtual Machine (JVM) argument and programmatically.
16
16
17
17
## Enabling with JVM argument
18
18
@@ -42,8 +42,7 @@ To enable Application Insights Java programmatically, you must add the following
42
42
</dependency>
43
43
```
44
44
45
-
And invoke the `attach()` method of the `com.microsoft.applicationinsights.attach.ApplicationInsights` class
46
-
in the first line of your `main()` method.
45
+
And invoke the `attach()` method of the `com.microsoft.applicationinsights.attach.ApplicationInsights` class that's in the beginning line of your `main()` method.
47
46
48
47
> [!WARNING]
49
48
>
@@ -73,15 +72,15 @@ public class SpringBootApp {
73
72
### Configuration
74
73
75
74
Programmatic enablement supports all the same [configuration options](./java-standalone-config.md)
76
-
as the JVM argument enablement, with the following differences below.
75
+
as the JVM argument enablement, with the differences that are described in the next sections.
77
76
78
77
#### Configuration file location
79
78
80
79
By default, when enabling Application Insights Java programmatically, the configuration file `applicationinsights.json`
81
-
will be read from the classpath (`src/main/resources`, `src/test/resources`).
80
+
is read from the classpath (`src/main/resources`, `src/test/resources`).
82
81
83
82
From 3.4.3, you can configure the name of a JSON file in the classpath with the `applicationinsights.runtime-attach.configuration.classpath.file` system property.
84
-
For example, with `-Dapplicationinsights.runtime-attach.configuration.classpath.file=applicationinsights-dev.json`, Application Insights will use`applicationinsights-dev.json` file for configuration. To programmatically configure another file in the classpath:
83
+
For example, with `-Dapplicationinsights.runtime-attach.configuration.classpath.file=applicationinsights-dev.json`, Application Insights uses the`applicationinsights-dev.json` file for configuration. To programmatically configure another file in the classpath:
85
84
86
85
```java
87
86
publicstaticvoid main(String[] args) {
@@ -141,6 +140,6 @@ Enable connection string configured at runtime:
141
140
#### Self-diagnostic log file location
142
141
143
142
By default, when enabling Application Insights Java programmatically, the `applicationinsights.log` file containing
144
-
the agent logs will be located in the directory from where the JVM is launched (user directory).
143
+
the agent logs are located in the directory from where the JVM is launched (user directory).
145
144
146
-
See [self-diagnostic configuration options](./java-standalone-config.md#self-diagnostics) to change this location.
145
+
To learn how to change this location, see your [self-diagnostic configuration options](./java-standalone-config.md#self-diagnostics).
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/java-standalone-config.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ The file should contain only the connection string and nothing else.
72
72
73
73
Not setting the connection string disables the Java agent.
74
74
75
-
If you have multiple applications deployed in the same JVM and want them to send telemetry to different connection strings, see [Connection string overrides (preview)](#connection-string-overrides-preview).
75
+
If you have multiple applications deployed in the same Java Virtual Machine (JVM) and want them to send telemetry to different connection strings, see [Connection string overrides (preview)](#connection-string-overrides-preview).
76
76
77
77
## Cloud role name
78
78
@@ -185,9 +185,9 @@ Sampling overrides allow you to override the [default sampling percentage](#samp
185
185
186
186
For more information, see the [Sampling overrides](./java-standalone-sampling-overrides.md) documentation.
187
187
188
-
## JMX metrics
188
+
## Java Management Extensions metrics
189
189
190
-
If you want to collect some other JMX metrics:
190
+
If you want to collect some other Java Management Extensions (JMX) metrics:
191
191
192
192
```json
193
193
{
@@ -209,12 +209,12 @@ If you want to collect some other JMX metrics:
209
209
In the preceding configuration example:
210
210
211
211
*`name` is the metric name that is assigned to this JMX metric (can be anything).
212
-
*`objectName` is the [Object Name](https://docs.oracle.com/javase/8/docs/api/javax/management/ObjectName.html) of the `JMX MBean` that you want to collect. Wildcard character asterisk (*) is supported.
212
+
*`objectName` is the [Object Name](https://docs.oracle.com/javase/8/docs/api/javax/management/ObjectName.html) of the `JMX MBean` that you want to collect. Wildcard character asterisk (*) is supported.
213
213
*`attribute` is the attribute name inside of the `JMX MBean` that you want to collect.
214
214
215
215
Numeric and Boolean JMX metric values are supported. Boolean JMX metrics are mapped to `0` for false and `1` for true.
216
216
217
-
See the [JMX metrics](./java-jmx-metrics-configuration.md) documentation for more details.
217
+
For more information, see the [JMX metrics](./java-jmx-metrics-configuration.md) documentation.
218
218
219
219
## Custom dimensions
220
220
@@ -251,7 +251,7 @@ Starting with version 3.2.0, you can set a custom dimension programmatically on
251
251
}
252
252
```
253
253
254
-
and then at the beginning of each request, call:
254
+
And then at the beginning of each request, call:
255
255
256
256
```java
257
257
Span.current().setAttribute("mycustomer", "xyz");
@@ -322,7 +322,7 @@ add this property to your json configuration:
322
322
}
323
323
```
324
324
325
-
and add`applicationinsights-core` to your application:
325
+
Add`applicationinsights-core` to your application:
326
326
327
327
```xml
328
328
<dependency>
@@ -332,7 +332,7 @@ and add `applicationinsights-core` to your application:
332
332
</dependency>
333
333
```
334
334
335
-
and use the static `configure(String)` method in the class
335
+
Use the static `configure(String)` method in the class
@@ -387,7 +387,7 @@ It automatically modifies to return:
387
387
</html>
388
388
```
389
389
390
-
The script is aiming at helping customers to track the web user data, and sent the collecting server-side telemetry back to users' Azure portal. Details can be found at [ApplicationInsights-JS](https://github.com/microsoft/ApplicationInsights-JS)
390
+
The script is aiming at helping customers to track the web user data, and sent the collecting server-side telemetry back to users' Azure portal. Details can be found at [ApplicationInsights-JS](https://github.com/microsoft/ApplicationInsights-JS).
391
391
392
392
If you want to enable this feature, add the below configuration option:
393
393
@@ -424,8 +424,8 @@ Logging is only captured if it:
424
424
* Meets the configured level for the logging framework.
425
425
* Also meets the configured level for Application Insights.
426
426
427
-
For example, if your logging framework is configured to log `WARN` (and aforementioned) from the package `com.example`,
428
-
and Application Insights is configured to capture `INFO` (and aforementioned), Application Insights only captures `WARN` (and more severe) from the package `com.example`.
427
+
For example, if your logging framework is configured to log `WARN` (and you configured it as described earlier) from the package `com.example`,
428
+
and Application Insights is configured to capture `INFO` (and you configured as described), Application Insights only captures `WARN` (and more severe) from the package `com.example`.
429
429
430
430
The default level configured for Application Insights is `INFO`. If you want to change this level:
431
431
@@ -515,7 +515,7 @@ Also, if your application uses [Spring Boot Actuator](https://docs.spring.io/spr
515
515
516
516
To send custom metrics using micrometer:
517
517
518
-
1. Add Micrometer to your application:
518
+
1. Add Micrometer to your application as shown in the following example.
519
519
520
520
```xml
521
521
<dependency>
@@ -525,13 +525,13 @@ To send custom metrics using micrometer:
525
525
</dependency>
526
526
```
527
527
528
-
1. Use the Micrometer [global registry](https://micrometer.io/?/docs/concepts#_global_registry) to create a meter:
528
+
1. Use the Micrometer [global registry](https://micrometer.io/?/docs/concepts#_global_registry) to create a meter as shown in the following example.
529
529
530
530
```java
531
531
static final Counter counter = Metrics.counter("test.counter");
532
532
```
533
533
534
-
1. Use the counter to record metrics:
534
+
1. Use the counter to record metrics by using the following command.
535
535
536
536
```java
537
537
counter.increment();
@@ -560,9 +560,9 @@ To disable autocollection of Micrometer metrics and Spring Boot Actuator metrics
560
560
}
561
561
```
562
562
563
-
## JDBC query masking
563
+
## Java Database Connectivity query masking
564
564
565
-
Literal values in JDBC queries are masked by default to avoid accidentally capturing sensitive data.
565
+
Literal values in Java Database Connectivity (JDBC) queries are masked by default to avoid accidentally capturing sensitive data.
566
566
567
567
Starting from 3.4.0, this behavior can be disabled. For example:
568
568
@@ -774,7 +774,7 @@ The setting applies to the following metrics:
774
774
775
775
***Default performance counters**: For example, CPU and memory
776
776
***Default custom metrics**: For example, garbage collection timing
777
-
***Configured JMX metrics**: [See the JMX metric section](#jmx-metrics)
777
+
***Configured JMX metrics**: [See the JMX metric section](#java-management-extensions-metrics)
778
778
***Micrometer metrics**: [See the Autocollected Micrometer metrics section](#autocollected-micrometer-metrics-including-spring-boot-actuator-metrics)
0 commit comments