Skip to content

Commit aab4fca

Browse files
authored
Update java profiler to be enabled by default
1 parent 54e3243 commit aab4fca

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

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

Lines changed: 8 additions & 20 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, as such the default trigger settings for CPU and Memory will apply and if breached profiles will be gathered. If you wish to subsequently disable profiling, this can be done withing the trigger menu as 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.
@@ -126,7 +114,7 @@ Application Insights instance within the Performance -> Profiler section. From t
126114

127115
### Configuration
128116

129-
Configuration of the profiler triggering settings, such as thresholds and profiling periods, are set within the ApplicationInsights UI under the Performance, Profiler, Triggers UI as described in [Installation](#installation).
117+
Configuration of the profiler triggering settings, such as thresholds and profiling periods, are set within the ApplicationInsights UI under the Performance, Profiler, Triggers UI as described in [Installation](#installation) .
130118

131119
Additionally, many parameters can be configured using environment variables and the `applicationinsights.json` configuration file.
132120

@@ -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, note that 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)