Type to search.

How to find slow methods

Serverless Observability

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

APM Agent Java

The Elastic APM Java agent enables you to trace the execution of operations in your Java applications, sending performance metrics and errors to the Elastic APM Server.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Identifying a problematic service is only half of the battle when diagnosing application slowdowns. Luckily, the Elastic APM Java Agent provides multiple ways to get method-level insights into your code. This can help you diagnose slow requests due to heavy computations, inefficient algorithms, or similar problems not related to interactions between services.

Find out which part of your code is making your application slow by periodically recording running methods with a sampling-based profiler.

green check Very low overhead.
green check No code changes required.
red x Does not work on Windows and on OpenJ9.
red x The duration of profiler-inferred spans are not exact measurements, only estimates.

Learn more

Use the API or OpenTracing bridge to manually create spans for methods of interest.

green check Most flexible.
red x Incorrect API usage may lead to invalid traces (scope leaks).

Learn more

Annotations can be placed on top of methods to automatically create spans for them.

green check Easier and more robust than the API.
red x Less flexible on its own, but can be combined with the API.

Learn more

Use a configuration option to specify additional methods to instrument.

green check No need to modify source code.
green check Possible to monitor code in third-party libraries.
green check Match methods via wildcards.
red x Easy to overuse which hurts runtime and startup performance.

Learn more