diff --git a/semantic_conventions/resource/cloud.yaml b/semantic_conventions/resource/cloud.yaml index 207baec0382..749a41702e2 100644 --- a/semantic_conventions/resource/cloud.yaml +++ b/semantic_conventions/resource/cloud.yaml @@ -13,7 +13,7 @@ groups: brief: 'Amazon Web Services' - id: Azure value: 'azure' - brief: 'Amazon Web Services' + brief: 'Microsoft Azure' - id: GCP value: 'gcp' brief: 'Google Cloud Platform' @@ -37,3 +37,12 @@ groups: note: > In AWS, this is called availability-zone. examples: ['us-central1-a'] + - id: infrastructure.service + type: string + brief: > + Description of cloud resource in use. + note: > + The first entry should generally be a cloud provider, followed by a product + category, then finally a particular piece of compute infrastructure. Each entry + is delimited by a double colon (::). + examples: ['AWS::EC2::Instance', 'Azure::Compute::VM', 'GCP::ComputeEngine::VM'] diff --git a/semantic_conventions/resource/cloud_provider/aws/aws.yaml b/semantic_conventions/resource/cloud_provider/aws/aws.yaml new file mode 100644 index 00000000000..c952b450965 --- /dev/null +++ b/semantic_conventions/resource/cloud_provider/aws/aws.yaml @@ -0,0 +1,34 @@ +groups: + - id: aws + prefix: aws + brief: > + Resources specific to Amazon Web Services. + attributes: + - id: loggroup.name + type: string + brief: > + The name of the AWS log group an application is writing to. + examples: ['/aws/lambda/my-function', 'opentelemetry-service'] + - id: loggroup.arn + type: string + brief: > + The Amazon Resource Name (ARN) of an AWS log group. + examples: ['arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*'] + note: > + See the + [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + - id: logstream.name + type: string + brief: > + The name of the AWS log stream an application is writing to. + examples: ['logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'] + - id: logstream.arn + type: string + brief: > + The ARN of the AWS log stream. + examples: ['arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'] + note: > + See the + [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + One log group can contain several log streams, so this ARN necessarily identifies both a log + group and a log stream. diff --git a/semantic_conventions/resource/cloud_provider/aws/ecs.yaml b/semantic_conventions/resource/cloud_provider/aws/ecs.yaml new file mode 100644 index 00000000000..ce5b6134c54 --- /dev/null +++ b/semantic_conventions/resource/cloud_provider/aws/ecs.yaml @@ -0,0 +1,38 @@ +groups: + - id: aws.ecs + prefix: aws.ecs + brief: > + Resources used by AWS Elastic Container Service (ECS). + attributes: + - id: container.arn + type: string + brief: > + The ARN of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). + examples: ['arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9'] + - id: cluster + type: string + brief: > + The name of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). + examples: ['opentelemetry-cluster'] + - id: launchtype + type: + allow_custom_values: false + members: + - id: EC2 + value: "EC2" + - id: Fargate + value: "Fargate" + brief: > + The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. + examples: ['EC2', 'Fargate'] + - id: task.arn + type: string + brief: > + The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). + examples: ['arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b'] + - id: task.family + type: string + brief: > + The task definition family this task definition is a member of. + examples: ['opentelemetry-family'] + diff --git a/specification/resource/semantic_conventions/README.md b/specification/resource/semantic_conventions/README.md index a7073284046..ebde4233f98 100644 --- a/specification/resource/semantic_conventions/README.md +++ b/specification/resource/semantic_conventions/README.md @@ -135,3 +135,9 @@ Attributes defining a running environment (e.g. Operating System, Cloud, Data Ce Version attributes, such as `service.version`, are values of type `string`. They are the exact version used to identify an artifact. This may be a semantic version, e.g., `1.2.3`, git hash, e.g., `8ae73a`, or an arbitrary version string, e.g., `0.1.2.20210101`, whatever was used when building the artifact. + +## Provider-Specific Attributes + +Attributes that are only applicable to resources from a specific cloud provider. Currently, these +resources can only be defined for providers listed as a valid `cloud.provider` in +[Cloud](./cloud.md). Provider-specific attributes all reside in the `cloud_provider` directory. diff --git a/specification/resource/semantic_conventions/cloud.md b/specification/resource/semantic_conventions/cloud.md index f755a8dceb5..790a732d81e 100644 --- a/specification/resource/semantic_conventions/cloud.md +++ b/specification/resource/semantic_conventions/cloud.md @@ -11,14 +11,17 @@ | `cloud.account.id` | string | The cloud account ID used to identify different entities. | `opentelemetry` | No | | `cloud.region` | string | A specific geographical location where different entities can run. | `us-central1` | No | | `cloud.zone` | string | Zones are a sub set of the region connected through low-latency links. [1] | `us-central1-a` | No | +| `cloud.infrastructure.service` | string | Description of cloud resource in use. [2] | `AWS::EC2::Instance`
`Azure::Compute::VM`
`GCP::ComputeEngine::VM` | No | **[1]:** In AWS, this is called availability-zone. +**[2]:** The first entry should generally be a cloud provider, followed by a product category, then finally a particular piece of compute infrastructure. Each entry is delimited by a double colon (::). + `cloud.provider` MUST be one of the following or, if none of the listed values apply, a custom value: | Value | Description | |---|---| | `aws` | Amazon Web Services | -| `azure` | Amazon Web Services | +| `azure` | Microsoft Azure | | `gcp` | Google Cloud Platform | diff --git a/specification/resource/semantic_conventions/cloud_provider/aws/aws.md b/specification/resource/semantic_conventions/cloud_provider/aws/aws.md new file mode 100644 index 00000000000..e4067697917 --- /dev/null +++ b/specification/resource/semantic_conventions/cloud_provider/aws/aws.md @@ -0,0 +1,18 @@ +# AWS + +**Type:** `aws` + +**Description:** Resources specific to Amazon Web Services. + + +| Attribute | Type | Description | Example | Required | +|---|---|---|---|---| +| `aws.loggroup.name` | string | The name of the AWS log group an application is writing to. | `/aws/lambda/my-function`
`opentelemetry-service` | No | +| `aws.loggroup.arn` | string | The Amazon Resource Name (ARN) of an AWS log group. [1] | `arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*` | No | +| `aws.logstream.name` | string | The name of the AWS log stream an application is writing to. | `logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` | No | +| `aws.logstream.arn` | string | The ARN of the AWS log stream. [2] | `arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` | No | + +**[1]:** See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + +**[2]:** See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so this ARN necessarily identifies both a log group and a log stream. + diff --git a/specification/resource/semantic_conventions/cloud_provider/aws/ecs.md b/specification/resource/semantic_conventions/cloud_provider/aws/ecs.md new file mode 100644 index 00000000000..a39e01479d1 --- /dev/null +++ b/specification/resource/semantic_conventions/cloud_provider/aws/ecs.md @@ -0,0 +1,22 @@ +# AWS ECS + +**type:** `aws.ecs` + +**Description:** Resources used by AWS Elastic Container Service (ECS). + + +| Attribute | Type | Description | Example | Required | +|---|---|---|---|---| +| `aws.ecs.container.arn` | string | The ARN of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). | `arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9` | No | +| `aws.ecs.cluster` | string | The name of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). | `opentelemetry-cluster` | No | +| `aws.ecs.launchtype` | string enum | The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. | `EC2`
`Fargate` | No | +| `aws.ecs.task.arn` | string | The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). | `arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b` | No | +| `aws.ecs.task.family` | string | The task definition family this task definition is a member of. | `opentelemetry-family` | No | + +`aws.ecs.launchtype` MUST be one of the following: + +| Value | Description | +|---|---| +| `EC2` | EC2 | +| `Fargate` | Fargate | +