Skip to content

Commit ea97b0e

Browse files
Merge pull request #224519 from johnoliver/enable-java-profiler
Update java profiler to be enabled by default
2 parents 6f25b3a + 3ad6add commit ea97b0e

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

articles/azure-monitor/app/java-standalone-profiler.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ The ApplicationInsights Java Agent monitors CPU and memory consumption and if it
6262

6363
Within the profiler user interface (see [profiler settings](../profiler/profiler-settings.md)) there's a **Profile now** button. Selecting this button will immediately request a profile in all agents that are attached to the Application Insights instance.
6464

65+
> [!WARNING]
66+
> Invoking Profile now will enable the profiler feature, and Application Insights will apply default CPU and memory SLA triggers. When your application breaches those SLAs, Application Insights will gather Java profiles. If you wish to disable profiling later on, you can do so within the trigger menu shown in [Installation](#installation).
67+
6568
#### CPU
6669

6770
CPU threshold is a percentage of the usage of all available cores on the system.
@@ -100,21 +103,6 @@ The following steps will guide you through enabling the profiling component on t
100103

101104
3. Configure the required CPU and Memory thresholds and select Apply.
102105
:::image type="content" source="./media/java-standalone-profiler/cpu-memory-trigger-settings.png" alt-text="Screenshot of trigger settings pane for CPU and Memory triggers.":::
103-
104-
1. Inside the `applicationinsights.json` configuration of your process, enable profiler with the `preview.profiler.enabled` setting:
105-
```json
106-
{
107-
"connectionString" : "...",
108-
"preview" : {
109-
"profiler" : {
110-
"enabled" : true
111-
}
112-
}
113-
}
114-
```
115-
Alternatively, set the `APPLICATIONINSIGHTS_PREVIEW_PROFILER_ENABLED` environment variable to true.
116-
117-
1. Restart your process with the updated configuration.
118106

119107
> [!WARNING]
120108
> The Java profiler does not support the "Sampling" trigger. Configuring this will have no effect.
@@ -138,8 +126,8 @@ Profiles can be generated/edited in the JDK Mission Control (JMC) user interface
138126

139127
### Environment variables
140128

141-
- `APPLICATIONINSIGHTS_PREVIEW_PROFILER_ENABLED`: boolean (default: `false`)
142-
Enables/disables the profiling feature.
129+
- `APPLICATIONINSIGHTS_PREVIEW_PROFILER_ENABLED`: boolean (default: `true`)
130+
Enables/disables the profiling feature. By default the feature is enabled within the agent (since agent 3.4.9). However, even though this feature is enabled within the agent, profiles will not be gathered unless enabled within the Portal as described in [Installation](#installation).
143131

144132
### Configuration file
145133

@@ -189,7 +177,7 @@ Azure Monitor Application Insights Java profiler uses Java Flight Recorder (JFR)
189177
Java Flight Recorder is a tool for collecting profiling data of a running Java application. It's integrated into the Java Virtual Machine (JVM) and is used for troubleshooting performance issues. Learn more about [Java SE JFR Runtime](https://docs.oracle.com/javacomponents/jmc-5-4/jfr-runtime-guide/about.htm#JFRUH170).
190178

191179
### What is the price and/or licensing fee implications for enabling App Insights Java Profiling?
192-
Java Profiling enablement is a free feature with Application Insights. [Azure Monitor Application Insights pricing](https://azure.microsoft.com/pricing/details/monitor/) is based on ingestion cost.
180+
Java Profiling is a free feature with Application Insights. [Azure Monitor Application Insights pricing](https://azure.microsoft.com/pricing/details/monitor/) is based on ingestion cost.
193181

194182
### Which Java profiling information is collected?
195183
Profiling data collected by the JFR includes: method and execution profiling data, garbage collection data, and lock profiles.
@@ -217,4 +205,4 @@ Review the [Pre-requisites](#prerequisites) at the top of this article.
217205

218206
### Can I use Java Profiling for microservices application?
219207

220-
Yes, you can profile a JVM running microservices using the JFR.
208+
Yes, you can profile a JVM running microservices using the JFR.

0 commit comments

Comments
 (0)