Skip to main content

AWS EC2

Migration Notice

This documentation reflects the updated attribute names using OpenTelemetry semantic conventions. The old attribute names (e.g., aws.ec2.instance_id, aws.ec2.instance_type, aws.region, aws.ec2.operating_system) are no longer supported. Please update your instrumentation to use the new attribute names described below.

Required AWS EC2 Attributes

The following cost calculation tags are required for traces originating from application and services running on AWS EC2 instances.

Always Required Fields

These fields are always required regardless of the instance type:

Attribute NameExample ValueAllowed Values
cloud.platformaws_ec2aws_ec2 (must be this exact value)
host.idi-abc1234Any valid EC2 instance ID
host.typet3.microAny valid EC2 instance type
cloud.regionus-east-1Any valid AWS region
os.typelinuxlinux, windows

Optional Fields

These fields have default values and only need to be provided when the default does not apply:

Attribute NameExample ValueAllowed ValuesDefault
aws.ec2.platform_detailsRed Hat Enterprise LinuxSee AWS documentationNone (only needed for Linux variants or pre-installed software)
aws.ec2.license_modelNo License requiredNo License required, Bring your own licenseNo License required
aws.ec2.tenancysharedshared, default, dedicated, hostshared
note

The value default for aws.ec2.tenancy is treated as a synonym for shared.

Understanding os.type and platform_details

The os.type attribute is required and indicates the base operating system. The aws.ec2.platform_details attribute is optional but necessary for accurate pricing when your instance runs:

  • Linux variants with different pricing (RHEL, SUSE, Ubuntu Pro)
  • Instances with pre-installed software (e.g., SQL Server)
os.typeplatform_detailsPricing Impact
linux(not provided)Standard Linux pricing
linuxRed Hat Enterprise LinuxRHEL pricing
linuxSUSE LinuxSUSE pricing
linuxUbuntu ProUbuntu Pro pricing
linuxRed Hat Enterprise Linux with SQL Server StandardRHEL + SQL Server Standard pricing
linuxLinux/UNIXStandard Linux pricing (explicit)
windows(not provided)Standard Windows pricing
windowsWindows with SQL Server EnterpriseWindows + SQL Server Enterprise pricing
windowsWindows with SQL Server StandardWindows + SQL Server Standard pricing
windowsWindows with SQL Server WebWindows + SQL Server Web pricing
tip

If your instance runs standard Amazon Linux, Amazon Linux 2, or standard Windows without pre-installed software, you do not need to provide aws.ec2.platform_details.

Additional Fields for Spot and Scheduled Instances

These fields are required only if the instance is Spot or Scheduled. If your instance is neither Spot nor Scheduled, you can either leave this attribute off or set it to null.

Attribute NameExample ValueAllowed Values
aws.ec2.instance_lifecyclespotspot, scheduled, on-demand

Additional Fields for Capacity Reservations

These fields are required only if the instance is using Capacity Reservations. If your instance is not using Capacity Reservations, you can either leave these attributes off or set them to null.

Attribute NameExample ValueAllowed Values
aws.ec2.capacity_reservation_idcr-0123456789abcdef0Any valid capacity reservation ID
aws.ec2.capacity_reservation_preferenceopenopen, none

Additional Fields for EC2 Fleet

These fields are required only if the instance is part of an EC2 Fleet. If your instance is not part of an EC2 Fleet, you can either leave these attributes off or set them to null.

Attribute NameExample ValueAllowed Values
aws.ec2.fleet_idfleet-12345678-1234-1234-1234-123456789012Any valid EC2 Fleet ID
aws.ec2.fleet_request_idsfr-12345678-1234-1234-1234-123456789012Any valid Spot Fleet request ID

Visualization with Mermaid

The diagram below shows which attributes are required and optional depending on the instance configuration.

Retrieving Instance Details

You can retrieve instance details in a variety of ways, such as through the AWS CLI and AWS API.

Beakpoint Insights SDKs

We will be releasing SDKs for various languages to make it easier to send these attributes to Beakpoint Insights. Stay tuned for updates!

Attribute Mapping from describe-instances

The following table shows how to map the describe-instances API response fields to Beakpoint Insights attributes:

Beakpoint Insights Attributedescribe-instances FieldNotes
cloud.platformN/AAlways set to aws_ec2 for EC2 instances
host.idInstanceIdMaps directly
host.typeInstanceTypeMaps directly
cloud.regionPlacement.AvailabilityZoneRemove the trailing letter (e.g., us-east-1cus-east-1)
os.typeN/ASet to linux or windows based on your AMI. You can also derive this from the PlatformDetails field (values containing "Windows" indicate windows, otherwise linux)
aws.ec2.platform_detailsPlatformDetailsMaps directly. Only needed for Linux variants (RHEL, SUSE, Ubuntu Pro) or instances with pre-installed software
aws.ec2.tenancyPlacement.TenancyMaps directly

AWS CLI

aws ec2 describe-instances --instance-ids i-abc123abc123 --region us-east-1

which will return:

{
"Reservations": [
{
"ReservationId": "r-123456",
"OwnerId": "123456789123456789",
"Groups": [],
"Instances": [
{
"Architecture": "x86_64",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/xvda",
"Ebs": {
"AttachTime": "2024-12-18T03:42:39+00:00",
"DeleteOnTermination": true,
"Status": "attached",
"VolumeId": "vol-123456789456456"
}
}
],
"ClientToken": "abcdefgh-8b11-5c11-4b3c-1234562d7809",
"EbsOptimized": false,
"EnaSupport": true,
"Hypervisor": "xen",
"IamInstanceProfile": {
"Arn": "arn:aws:iam::xxxxxxxxxxx:instance-profile/DescribeImages",
"Id": "AIPAWMFUO5NBK46JGNL5H"
},
"NetworkInterfaces": [
{
"Association": {
"IpOwnerId": "amazon",
"PublicDnsName": "ec2-34-226-121-173.compute-1.amazonaws.com",
"PublicIp": "1.2.3.4"
},
"Attachment": {
"AttachTime": "2024-12-18T03:42:39+00:00",
"AttachmentId": "eni-attach-abc123",
"DeleteOnTermination": true,
"DeviceIndex": 0,
"Status": "attached",
"NetworkCardIndex": 0
},
"Description": "",
"Groups": [
{
"GroupId": "sg-1234567897897899",
"GroupName": "my-group"
}
],
"Ipv6Addresses": [],
"MacAddress": "12:89:85:e5:d8:a7",
"NetworkInterfaceId": "eni-03c73dcd24e0ceb5f",
"OwnerId": "xxxxxxxxxxx",
"PrivateDnsName": "ip-172-31-80-86.ec2.internal",
"PrivateIpAddress": "172.31.80.86",
"PrivateIpAddresses": [
{
"Association": {
"IpOwnerId": "amazon",
"PublicDnsName": "ec2-1-2-3-4.compute-1.amazonaws.com",
"PublicIp": "1.2.3.4"
},
"Primary": true,
"PrivateDnsName": "ip-172-31-80-86.ec2.internal",
"PrivateIpAddress": "172.31.80.86"
}
],
"SourceDestCheck": true,
"Status": "in-use",
"SubnetId": "subnet-123123123456456",
"VpcId": "vpc-111222333111222333",
"InterfaceType": "interface",
"Operator": {
"Managed": false
}
}
],
"RootDeviceName": "/dev/xvda",
"RootDeviceType": "ebs",
"SecurityGroups": [
{
"GroupId": "sg-1234567897897899",
"GroupName": "my-group"
}
],
"SourceDestCheck": true,
"Tags": [
{
"Key": "Name",
"Value": "MyEc2Instance"
}
],
"VirtualizationType": "hvm",
"CpuOptions": {
"CoreCount": 1,
"ThreadsPerCore": 1
},
"CapacityReservationSpecification": {
"CapacityReservationPreference": "open"
},
"HibernationOptions": {
"Configured": false
},
"MetadataOptions": {
"State": "applied",
"HttpTokens": "required",
"HttpPutResponseHopLimit": 2,
"HttpEndpoint": "enabled",
"HttpProtocolIpv6": "disabled",
"InstanceMetadataTags": "disabled"
},
"EnclaveOptions": {
"Enabled": false
},
"BootMode": "uefi-preferred",
"PlatformDetails": "Linux/UNIX",
"UsageOperation": "RunInstances",
"UsageOperationUpdateTime": "2024-12-18T03:42:39+00:00",
"PrivateDnsNameOptions": {
"HostnameType": "ip-name",
"EnableResourceNameDnsARecord": true,
"EnableResourceNameDnsAAAARecord": false
},
"MaintenanceOptions": {
"AutoRecovery": "default"
},
"CurrentInstanceBootMode": "legacy-bios",
"NetworkPerformanceOptions": {
"BandwidthWeighting": "default"
},
"Operator": {
"Managed": false
},
"InstanceId": "i-abc123abc123",
"ImageId": "ami-01816d07b1128cd2d",
"State": {
"Code": 16,
"Name": "running"
},
"PrivateDnsName": "ip-172-31-80-86.ec2.internal",
"PublicDnsName": "ec2-1-2-3-4.compute-1.amazonaws.com",
"StateTransitionReason": "",
"KeyName": "MySecurityKey",
"AmiLaunchIndex": 0,
"ProductCodes": [],
"InstanceType": "t2.micro",
"LaunchTime": "2024-12-18T03:42:39+00:00",
"Placement": {
"GroupName": "",
"Tenancy": "default",
"AvailabilityZone": "us-east-1c"
},
"Monitoring": {
"State": "disabled"
},
"SubnetId": "subnet-123123123",
"VpcId": "vpc-123132132123",
"PrivateIpAddress": "172.31.80.86",
"PublicIpAddress": "1.2.3.4"
}
]
}
]
}