AWS EC2
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 Name | Example Value | Allowed Values |
|---|---|---|
cloud.platform | aws_ec2 | aws_ec2 (must be this exact value) |
host.id | i-abc1234 | Any valid EC2 instance ID |
host.type | t3.micro | Any valid EC2 instance type |
cloud.region | us-east-1 | Any valid AWS region |
os.type | linux | linux, windows |
Optional Fields
These fields have default values and only need to be provided when the default does not apply:
| Attribute Name | Example Value | Allowed Values | Default |
|---|---|---|---|
aws.ec2.platform_details | Red Hat Enterprise Linux | See AWS documentation | None (only needed for Linux variants or pre-installed software) |
aws.ec2.license_model | No License required | No License required, Bring your own license | No License required |
aws.ec2.tenancy | shared | shared, default, dedicated, host | shared |
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.type | platform_details | Pricing Impact |
|---|---|---|
linux | (not provided) | Standard Linux pricing |
linux | Red Hat Enterprise Linux | RHEL pricing |
linux | SUSE Linux | SUSE pricing |
linux | Ubuntu Pro | Ubuntu Pro pricing |
linux | Red Hat Enterprise Linux with SQL Server Standard | RHEL + SQL Server Standard pricing |
linux | Linux/UNIX | Standard Linux pricing (explicit) |
windows | (not provided) | Standard Windows pricing |
windows | Windows with SQL Server Enterprise | Windows + SQL Server Enterprise pricing |
windows | Windows with SQL Server Standard | Windows + SQL Server Standard pricing |
windows | Windows with SQL Server Web | Windows + SQL Server Web pricing |
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 Name | Example Value | Allowed Values |
|---|---|---|
aws.ec2.instance_lifecycle | spot | spot, 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 Name | Example Value | Allowed Values |
|---|---|---|
aws.ec2.capacity_reservation_id | cr-0123456789abcdef0 | Any valid capacity reservation ID |
aws.ec2.capacity_reservation_preference | open | open, 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 Name | Example Value | Allowed Values |
|---|---|---|
aws.ec2.fleet_id | fleet-12345678-1234-1234-1234-123456789012 | Any valid EC2 Fleet ID |
aws.ec2.fleet_request_id | sfr-12345678-1234-1234-1234-123456789012 | Any 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.
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 Attribute | describe-instances Field | Notes |
|---|---|---|
cloud.platform | N/A | Always set to aws_ec2 for EC2 instances |
host.id | InstanceId | Maps directly |
host.type | InstanceType | Maps directly |
cloud.region | Placement.AvailabilityZone | Remove the trailing letter (e.g., us-east-1c → us-east-1) |
os.type | N/A | Set 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_details | PlatformDetails | Maps directly. Only needed for Linux variants (RHEL, SUSE, Ubuntu Pro) or instances with pre-installed software |
aws.ec2.tenancy | Placement.Tenancy | Maps 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"
}
]
}
]
}