View a markdown version of this page

Send profiles to CloudWatch - Amazon CloudWatch

Send profiles to CloudWatch

After your profiler produces OTLP profile data, send it to the CloudWatch profiles endpoint in one of the following ways. Profilers that don't sign their requests, such as async-profiler, must send through the CloudWatch agent or an OpenTelemetry Collector. For instructions on producing the profile data, see Profile your application.

Use the CloudWatch agent

You can send profiles to CloudWatch through the CloudWatch agent version 1.300075.0 and later. The agent sends the profile data that it receives on its OTLP endpoint to CloudWatch. It signs the data with its IAM role. The OTLP endpoint is off by default, so turn it on with the otlp source under opentelemetry.collect. For more information, see Send OpenTelemetry data using the agent configuration file. If you omit grpc_endpoint and http_endpoint, the agent listens on 127.0.0.1 only. Then only processes in the same network namespace can reach it. Keep that default when your profiler runs in the same network namespace as the agent. If you set the agent to listen on other addresses, restrict access with network controls such as security groups, host firewalls, or Kubernetes network policies. Profiles need no other setting, and the agent turns on the Collector profiles feature gate for you. When you turn on profiling with the CloudWatch Observability EKS add-on or the Helm chart, they turn on the OTLP endpoint for you. For more information, see Use the EKS add-on or Helm chart.

Use an OpenTelemetry Collector

The OpenTelemetry Collector keeps profiles support behind a feature gate, because the support is still in development. A feature gate turns on a Collector feature that is still in development. Without the profiles feature gate, the Collector doesn't accept a profiles pipeline. The CloudWatch agent turns on this gate for you.

To send profiles to CloudWatch through an OpenTelemetry Collector, do the following:

  1. Start the Collector with the --feature-gates=+service.profilesSupport command line option.

  2. Set profiles_endpoint of the otlp_http exporter to the CloudWatch profiles endpoint.

  3. Authenticate your requests. For more information, see Send directly to the endpoint. To sign with SigV4, the Collector distribution must include a SigV4 authenticator extension.

For everything else, see the OpenTelemetry Collector documentation on the OpenTelemetry website.

Send directly to the endpoint

A client can send OTLP/HTTP profile data directly to the endpoint in Direct OTLP ingestion endpoint. Sign each request with AWS Signature Version 4 (SigV4) using the signing service name monitoring, or send a CloudWatch API key as a bearer token. For API keys, see Setting up bearer token authentication for metrics and profiles. When you use temporary credentials, include the session token in the x-amz-security-token header.

Use the EKS add-on or Helm chart

On Kubernetes, you can use the CloudWatch Observability EKS add-on (version v8.0.1-eksbuild.1 or later) or the amazon-cloudwatch-observability Helm chart (version 8.0.0 or later). They turn on the profiler for your Java workloads and send its profiles to CloudWatch. When you set manager.autoInstrumentationConfiguration.java.profiling.enabled to the string "true", the operator turns on the ADOT Java agent profiler in new pods. It points the profiler at the CloudWatch agent on the same node. Restart your workloads after you change the setting. For setup steps and considerations, see Profile Java workloads on Kubernetes. For more information about the add-on, see OTel Container Insights (Recommended).