Skip to content

Commit 3df4ec4

Browse files
authored
Add semantic conventions for cloud provider-specific resource attributes (#1099)
1 parent f6f976a commit 3df4ec4

File tree

6 files changed

+148
-0
lines changed

6 files changed

+148
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
groups:
2+
- id: aws.ecs
3+
prefix: aws.ecs
4+
brief: >
5+
Resources used by AWS Elastic Container Service (ECS).
6+
attributes:
7+
- id: container.arn
8+
type: string
9+
brief: >
10+
The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
11+
examples: ['arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9']
12+
- id: cluster.arn
13+
type: string
14+
brief: >
15+
The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
16+
examples: ['arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster']
17+
- id: launchtype
18+
type:
19+
allow_custom_values: false
20+
members:
21+
- id: ec2
22+
value: "EC2"
23+
- id: fargate
24+
value: "Fargate"
25+
brief: >
26+
The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task.
27+
examples: ['EC2', 'Fargate']
28+
- id: task.arn
29+
type: string
30+
brief: >
31+
The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html).
32+
examples: ['arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b']
33+
- id: task.family
34+
type: string
35+
brief: >
36+
The task definition family this task definition is a member of.
37+
examples: ['opentelemetry-family']
38+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
groups:
2+
- id: aws.log
3+
prefix: aws.log
4+
brief: >
5+
Resources specific to Amazon Web Services.
6+
attributes:
7+
- id: group.names
8+
type: string[]
9+
brief: >
10+
The name(s) of the AWS log group(s) an application is writing to.
11+
examples: ['/aws/lambda/my-function', 'opentelemetry-service']
12+
note: >
13+
Multiple log groups must be supported for cases like multi-container applications,
14+
where a single application has sidecar containers, and each write to their own log
15+
group.
16+
- id: group.arns
17+
type: string[]
18+
brief: >
19+
The Amazon Resource Name(s) (ARN) of the AWS log group(s).
20+
examples: ['arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*']
21+
note: >
22+
See the
23+
[log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
24+
- id: stream.names
25+
type: string[]
26+
brief: >
27+
The name(s) of the AWS log stream(s) an application is writing to.
28+
examples: ['logs/main/10838bed-421f-43ef-870a-f43feacbbb5b']
29+
- id: stream.arns
30+
type: string[]
31+
brief: >
32+
The ARN(s) of the AWS log stream(s).
33+
examples: ['arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b']
34+
note: >
35+
See the
36+
[log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
37+
One log group can contain several log streams, so these ARNs necessarily identify both a log
38+
group and a log stream.

specification/resource/semantic_conventions/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,14 @@ Attributes defining a running environment (e.g. Operating System, Cloud, Data Ce
135135
Version attributes, such as `service.version`, are values of type `string`. They are
136136
the exact version used to identify an artifact. This may be a semantic version, e.g., `1.2.3`, git hash, e.g.,
137137
`8ae73a`, or an arbitrary version string, e.g., `0.1.2.20210101`, whatever was used when building the artifact.
138+
139+
## Cloud-Provider-Specific Attributes
140+
141+
Attributes that are only applicable to resources from a specific cloud provider. Currently, these
142+
resources can only be defined for providers listed as a valid `cloud.provider` in
143+
[Cloud](./cloud.md) and below. Provider-specific attributes all reside in the `cloud_provider` directory.
144+
Valid cloud providers are:
145+
146+
- [Amazon Web Services](https://aws.amazon.com/) ([`aws`](cloud_provider/aws/README.md))
147+
- [Google Cloud Platform](https://cloud.google.com/) (`gcp`)
148+
- [Microsoft Azure](https://azure.microsoft.com/) (`azure`)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# AWS Semantic Conventions
2+
3+
This directory defines standards for resource attributes that only apply to Amazon
4+
Web Services (AWS) resources. If an attribute could apply to resources from more than one cloud
5+
provider (like account ID, operating system, etc), it belongs in the parent
6+
`semantic_conventions` directory.
7+
8+
## Generic AWS Attributes
9+
10+
Attributes that relate to AWS or use AWS-specific terminology, but are used by several
11+
services within AWS or are abstracted away from any particular service:
12+
13+
- [AWS Logs](./logs.md)
14+
15+
## Services
16+
17+
Attributes that relate to an individual AWS service:
18+
19+
- [Elastic Container Service](./ecs.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# AWS ECS
2+
3+
**type:** `aws.ecs`
4+
5+
**Description:** Resources used by AWS Elastic Container Service (ECS).
6+
7+
<!-- semconv aws.ecs -->
8+
| Attribute | Type | Description | Example | Required |
9+
|---|---|---|---|---|
10+
| `aws.ecs.container.arn` | string | The Amazon Resource Name (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 |
11+
| `aws.ecs.cluster.arn` | string | The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). | `arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster` | No |
12+
| `aws.ecs.launchtype` | string enum | The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. | `EC2`<br>`Fargate` | No |
13+
| `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 |
14+
| `aws.ecs.task.family` | string | The task definition family this task definition is a member of. | `opentelemetry-family` | No |
15+
16+
`aws.ecs.launchtype` MUST be one of the following:
17+
18+
| Value | Description |
19+
|---|---|
20+
| `EC2` | ec2 |
21+
| `Fargate` | fargate |
22+
<!-- endsemconv -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# AWS Logs
2+
3+
**Type:** `aws.log`
4+
5+
**Description:** Log attributes for Amazon Web Services.
6+
7+
<!-- semconv aws.log -->
8+
| Attribute | Type | Description | Example | Required |
9+
|---|---|---|---|---|
10+
| `aws.log.group.names` | string[] | The name(s) of the AWS log group(s) an application is writing to. [1] | `/aws/lambda/my-function`<br>`opentelemetry-service` | No |
11+
| `aws.log.group.arns` | string[] | The Amazon Resource Name(s) (ARN) of the AWS log group(s). [2] | `arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*` | No |
12+
| `aws.log.stream.names` | string[] | The name(s) of the AWS log stream(s) an application is writing to. | `logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` | No |
13+
| `aws.log.stream.arns` | string[] | The ARN(s) of the AWS log stream(s). [3] | `arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` | No |
14+
15+
**[1]:** Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group.
16+
17+
**[2]:** See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
18+
19+
**[3]:** 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 these ARNs necessarily identify both a log group and a log stream.
20+
<!-- endsemconv -->

0 commit comments

Comments
 (0)