Prerequisites for profiles in Omni
Profiles in Omni need profile data in the account and Region of your space, and the permission to read it.
- Profile data
-
Omni reads the profile data in the
defaultCloudWatch Dataset of the space's account and Region. You don't configure a profile pipeline in Omni. By default, this profile data appears in your space. For the collection paths, see Publish profile data to Amazon CloudWatch. To profile a Java application end to end, see Tutorials: Profile Java applications. - Permission to read profiles
-
Reading a profile requires the
cloudwatch:GetProfileRecordspermission. Two AWS managed policies grant it:-
CloudWatchOmniSpaceAccessPolicy, for the space itself. Like the other space permissions, it requires thecloudwatch:HasAccessGrantcondition. -
CloudWatchOmniAWSIntegrationPolicyV2, for the space operator role, which also grants read access to the logs and traces in thedefaultDataset. If your space operator role still hasCloudWatchOmniAWSIntegrationPolicy, replace it with the V2 policy.
For both policies, see AWS managed policies for CloudWatch Omni.
-
- Encrypted profile data
-
If the Dataset is encrypted with a customer managed AWS KMS key, the identity that reads profiles also needs
kms:Decryptthrough CloudWatch for that key.CloudWatchOmniAWSIntegrationPolicyV2includes it for thedefaultDataset. For more information, see Encryption at rest for OpenTelemetry metrics and profiles.
A space covers one account and one Region, and profiles follow that boundary like the rest of your telemetry. To read profiles from more than one account or Region, see Set up Omni for your organization.
Recommended resource attributes for correlation
Omni places a profile on a service by its service name, account, Region, and service
namespace. Set the same service.name, and the same
service.namespace if you use one, on your profile data as on the
service's traces and metrics, so that Omni shows the profiles on that service, for
example in the application map and the service drawer. See Open a profile. Profiles store
resource attributes as labels with the @resource. prefix. See Profile type IDs and labels.
Set the following resource attributes on your profile data. CloudWatch and the CloudWatch agent set some of them for you.
-
Service name:
@resource.service.nameis required. Use the same service name as your traces and metrics. If profile data arrives at the CloudWatch agent without a service name, the agent sets it tounknown_service. On Kubernetes, the agent first tries to derive it from pod annotations,app.kubernetes.iolabels, or the workload, such as the deployment name. Profiles namedunknown_servicedon't appear on any service in Omni, but you can still query them in Explore. Profile data sent to CloudWatch directly without a service name is rejected. -
Account, Region, and cloud attributes:
@aws.accountand@aws.regionare the account and Region that received the data. In a centralized copy, that's the destination account and Region.@resource.cloud.account.idand@resource.cloud.regionidentify the source account and Region where your resource is deployed, when your sender sets them. For more information, see Profile type IDs and labels and Cross-account cross-Region profiles centralization in Amazon CloudWatch.When you send through the CloudWatch agent, the agent sets
@resource.cloud.provider,@resource.cloud.account.id, and@resource.cloud.regionfor you. With an OpenTelemetry Collector, add aresourcedetectionprocessor (for example, theec2orecsdetector) to set them. -
Service namespace:
@resource.service.namespaceis recommended. It's a logical group of services, such as an application name. Set it in the application withOTEL_RESOURCE_ATTRIBUTES=service.namespace=, wherenamenameis your namespace value. Or set it in the CloudWatch agent with theresource_attributesfield of theopentelemetrysection. See CloudWatch agent configuration file: OpenTelemetry section. On Kubernetes, if you don't set it, the agent uses theresource.opentelemetry.io/service.namespacepod annotation or, failing that, the Kubernetes namespace. -
Deployment environment:
@resource.deployment.environment.nameis recommended, such asprodorbeta. Set it the same ways as the service namespace.If you don't set it and the CloudWatch agent detects the platform (on Kubernetes, also the cluster name and namespace), the agent sets a default derived from the platform. The default starts with the
cloud.platformvalue and a colon. The Auto Scaling group, Amazon ECS cluster, or Kubernetes cluster and namespace follows the colon. For example,aws_ec2:default,aws_ec2:,asg-nameaws_ecs:, orcluster-nameaws_eks:.cluster-name/namespaceThis default isn't the same as the one that Application Signals uses, such as
ec2:default, so set your own value to match the environment on your other telemetry. The agent checks onlydeployment.environment.name, so it adds its default even if your SDK sets the olderdeployment.environmentkey.
If the application sets the service namespace or the deployment environment, the
agent keeps that value instead of adding its default. A value in the agent's
resource_attributes field replaces the value that the application sent,
for every service that sends through that agent. For the attributes that the
agent detects, such as cloud.* and host.*, the detected value
replaces any value set in the application or in
resource_attributes.
The following table lists the resource attributes to set on your profile data, and which ones CloudWatch or the CloudWatch agent sets for you.
Label |
Set by |
|---|---|
|
Your profiler, from the service name you configure (for
example, |
|
CloudWatch |
|
The CloudWatch agent, when it runs on Amazon EC2 or Amazon ECS, including Kubernetes nodes on Amazon EC2 where the agent can read instance metadata |
|
You (on Kubernetes, the CloudWatch agent sets a default if it's missing) |
|
You (the CloudWatch agent sets a default if it's missing and it detects the platform) |