Java Mail

Java Profiling

Overview

Instana AutoProfile is a production-grade performance profiler built for both production and development environments. It gives developers continuous and historical code-level view of application performance that is essential for locating CPU, memory allocation and I/O hot spots as well as latency bottlenecks. Included runtime metrics and error monitoring complement profiles for extensive performance analysis. Learn more at Instana AutoProfile.com.

Features

  • Continuous hot spot profiling of CPU usage and locks.
  • Health monitoring including CPU, memory, garbage collection and other runtime metrics.
  • Alerts on profile anomalies.
  • Team access.

Learn more on the Analyzing Profiles documentation page (with screenshots).

Documentation

See full documentation for reference.

Supported environment

  • Linux and macOS. Java 1.7 or higher.

Getting started

Create Instana AutoProfile account

Sign up for a free account at Instana AutoProfile.com (also with GitHub login).

Installing and configuring the agent – OPTION 1

Download the Instana AutoProfile.jar file.

Add -javaagent:/path/to/Instana AutoProfile.jar Java option.

Configure the agent using environment variables:

  • SI_AGENT_KEY (Required) The API key for communication with the Instana AutoProfile servers.
  • SI_APP_NAME (Required) A name to identify and group application data. Typically, a single codebase, deployable unit or executable module corresponds to one application.
  • SI_APP_VERSION (Optional) Sets application version, which can be used to associate profiling information with the source code release.
  • SI_APP_ENVIRONMENT (Optional) Used to differentiate applications in different environments.
  • SI_HOST_NAME (Optional) By default, host name will be the OS hostname.
  • SI_DEBUG_MODE (Optional) Enables debug logging.
  • SI_CPU_PROFILER_DISABLED, SI_LOCK_PROFILER_DISABLED (Optional) Disables respective profiler when true.

Alternatively, the agent can be configured using Java system properties, e.g. si.agent.key, si.app.name, etc.

Installing and configuring the agent – OPTION 2

Download the Instana AutoProfile.jar file.

Add the jar file to the classpath.

Import the agent in your application:

import com.Instana AutoProfile.agent.Instana AutoProfile;

Start the agent when the application starts:

Instana AutoProfile.start(String agentKey, String appName);

The agent can be configured by setting initialization options using the following methods prior to calling the start() method:

  • Instana AutoProfile.setAppVersion(String appVersion) (Optional) Sets application version, which can be used to associate profiling information with the source code release.
  • Instana AutoProfile.setAppEnvironment(String appEnvironment) (Optional) Used to differentiate applications in different environments.
  • Instana AutoProfile.setHostName(String hostName) (Optional) By default, host name will be the OS hostname.
  • Instana AutoProfile.setDebugMode(boolean isDebugMode) (Optional) Enables debug logging.
  • Instana AutoProfile.setCPUProfilerDisabled(boolean isDisabled), setLockProfilerDisabled(boolean isDisabled) (Optional) Disables respective profiler when true.

Shutting down the agent

Optional

Use Instana AutoProfile.destroy() to stop the agent if necessary. This method is automatically called on JVM shutdown.

Analyzing performance data in the Dashboard

Once your application is restarted, you can start observing continuous CPU and lock hot spot profiles as well as process metrics in the Dashboard.

Screenshot

Troubleshooting

To enable debug logging, use Instana AutoProfile.setDebugMode(true) method. If the debug log doesn't give you any hints on how to fix a problem, please report it to our support team in your account's Support section.

Overhead

The agent overhead is measured to be less than 1% for applications under high load.

Play with Instana’s APM Observability Sandbox

Start your FREE TRIAL today!