From ae07bd23b5ce135551d3b29000b16241f6764464 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Tue, 12 Dec 2023 12:30:51 +0100 Subject: [PATCH 1/5] [cloud-provider] Add semantic convention for AWS EC2 instance id --- docs/resource/cloud-provider/aws/ec2.md | 17 +++++++++++++++++ model/resource/cloud_provider/aws/ec2.yaml | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 docs/resource/cloud-provider/aws/ec2.md create mode 100644 model/resource/cloud_provider/aws/ec2.yaml diff --git a/docs/resource/cloud-provider/aws/ec2.md b/docs/resource/cloud-provider/aws/ec2.md new file mode 100644 index 0000000000..14283cc932 --- /dev/null +++ b/docs/resource/cloud-provider/aws/ec2.md @@ -0,0 +1,17 @@ +# AWS EC2 + +**Status**: [Experimental][DocumentStatus] + +**type:** `aws.ec2` + +**Description:** Resources used by Amazon Elastic Compute Cloud (Amazon EC2). + + +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `aws.ec2.instance.id` | string | The instance id of an AWS EC2 instance. This is the value provided by the EC2 Metadata endpoint under `instance-id`. [1] | `i-1234567890abcdef0` | Recommended | + +**[1]:** When both `host.id` and `aws.ec2.instance.id` are present, they SHOULD be equal. + + +[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md diff --git a/model/resource/cloud_provider/aws/ec2.yaml b/model/resource/cloud_provider/aws/ec2.yaml new file mode 100644 index 0000000000..9e32325956 --- /dev/null +++ b/model/resource/cloud_provider/aws/ec2.yaml @@ -0,0 +1,16 @@ +groups: + - id: aws.ec2 + prefix: aws.ec2 + type: resource + brief: > + Resources used by Amazon Elastic Compute Cloud (Amazon EC2). + attributes: + - id: instance.id + type: string + brief: > + The instance id of an AWS EC2 instance. This is the value + provided by the EC2 Metadata endpoint under `instance-id`. + note: > + When both `host.id` and `aws.ec2.instance.id` are present, + they SHOULD be equal. + examples: ['i-1234567890abcdef0'] From d9b40931387704ad6a3482baba48514aac7e367a Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Tue, 12 Dec 2023 12:39:04 +0100 Subject: [PATCH 2/5] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83e2c7c260..1efb05e2ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,8 @@ release. ([#163](https://github.com/open-telemetry/semantic-conventions/pull/163)) - Add .NET 8.0 metrics for HTTP client, ASP.NET Core, SignalR server and Kestrel. ([#283](https://github.com/open-telemetry/semantic-conventions/pull/283)) +- Add `aws.ec2.instance.id` resource attribute for AWS EC2 VMs. + ([#600](https://github.com/open-telemetry/semantic-conventions/pull/600)) ### Fixes From 7d194f7095734a6209d9095f5500b25d060d9b3f Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Tue, 12 Dec 2023 13:03:15 +0100 Subject: [PATCH 3/5] Apply suggestions from code review Co-authored-by: Armin Ruech <7052238+arminru@users.noreply.github.com> --- model/resource/cloud_provider/aws/ec2.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model/resource/cloud_provider/aws/ec2.yaml b/model/resource/cloud_provider/aws/ec2.yaml index 9e32325956..3299fed44a 100644 --- a/model/resource/cloud_provider/aws/ec2.yaml +++ b/model/resource/cloud_provider/aws/ec2.yaml @@ -9,7 +9,8 @@ groups: type: string brief: > The instance id of an AWS EC2 instance. This is the value - provided by the EC2 Metadata endpoint under `instance-id`. + provided by the [EC2 Metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html) + endpoint under `instance-id`. note: > When both `host.id` and `aws.ec2.instance.id` are present, they SHOULD be equal. From ba53832deefe74e4beedfe96d175c4202171c962 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Tue, 12 Dec 2023 13:04:37 +0100 Subject: [PATCH 4/5] make table-generation --- docs/resource/cloud-provider/aws/ec2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resource/cloud-provider/aws/ec2.md b/docs/resource/cloud-provider/aws/ec2.md index 14283cc932..ad22d4d5b8 100644 --- a/docs/resource/cloud-provider/aws/ec2.md +++ b/docs/resource/cloud-provider/aws/ec2.md @@ -9,7 +9,7 @@ | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `aws.ec2.instance.id` | string | The instance id of an AWS EC2 instance. This is the value provided by the EC2 Metadata endpoint under `instance-id`. [1] | `i-1234567890abcdef0` | Recommended | +| `aws.ec2.instance.id` | string | The instance id of an AWS EC2 instance. This is the value provided by the [EC2 Metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html) endpoint under `instance-id`. [1] | `i-1234567890abcdef0` | Recommended | **[1]:** When both `host.id` and `aws.ec2.instance.id` are present, they SHOULD be equal. From 0e71d057cf3629fecf49d8b89aac15f020ac02a9 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Mon, 5 Feb 2024 17:33:03 +0100 Subject: [PATCH 5/5] Switch to chloggen --- .chloggen/mx-psi_ec2-instance-id.yaml | 21 +++++++++++++++++++++ CHANGELOG.md | 2 -- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 .chloggen/mx-psi_ec2-instance-id.yaml diff --git a/.chloggen/mx-psi_ec2-instance-id.yaml b/.chloggen/mx-psi_ec2-instance-id.yaml new file mode 100755 index 0000000000..023845e6c9 --- /dev/null +++ b/.chloggen/mx-psi_ec2-instance-id.yaml @@ -0,0 +1,21 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: resource/cloud-provider + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add `aws.ec2.instance.id` resource attribute for AWS EC2 VMs. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [600] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/CHANGELOG.md b/CHANGELOG.md index 92d8625ac4..627a6650f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,8 +40,6 @@ ([#452](https://github.com/open-telemetry/semantic-conventions/pull/452/)) - Add an example for gcp_pubsub asynchronous batch publish ([#545](https://github.com/open-telemetry/semantic-conventions/pull/545)) -- Add `aws.ec2.instance.id` resource attribute for AWS EC2 VMs. - ([#600](https://github.com/open-telemetry/semantic-conventions/pull/600)) - Add `aws.ecs.task.id` attribute, corrected description for `aws.ecs.task.arn`. ([#597](https://github.com/open-telemetry/semantic-conventions/pull/597)) - Add Azure Service Bus and Event Hubs messaging attributes