Skip to content

Commit b158045

Browse files
author
William Armiros
committed
proposal for cloud provider-specific resource semantic conventions
1 parent 507884f commit b158045

File tree

7 files changed

+132
-2
lines changed

7 files changed

+132
-2
lines changed

semantic_conventions/resource/cloud.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ groups:
1313
brief: 'Amazon Web Services'
1414
- id: Azure
1515
value: 'azure'
16-
brief: 'Amazon Web Services'
16+
brief: 'Microsoft Azure'
1717
- id: GCP
1818
value: 'gcp'
1919
brief: 'Google Cloud Platform'
@@ -37,3 +37,12 @@ groups:
3737
note: >
3838
In AWS, this is called availability-zone.
3939
examples: ['us-central1-a']
40+
- id: infrastructure.service
41+
type: string
42+
brief: >
43+
Description of cloud resource in use.
44+
note: >
45+
The first entry should generally be a cloud provider, followed by a product
46+
category, then finally a particular piece of compute infrastructure. Each entry
47+
is delimited by a double colon (::).
48+
examples: ['AWS::EC2::Instance', 'Azure::Compute::VM', 'GCP::ComputeEngine::VM']
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
groups:
2+
- id: aws
3+
prefix: aws
4+
brief: >
5+
Resources specific to Amazon Web Services.
6+
attributes:
7+
- id: loggroup.name
8+
type: string
9+
brief: >
10+
The name of the AWS log group an application is writing to.
11+
examples: ['/aws/lambda/my-function', 'opentelemetry-service']
12+
- id: loggroup.arn
13+
type: string
14+
brief: >
15+
The Amazon Resource Name (ARN) of an AWS log group.
16+
examples: ['arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*']
17+
note: >
18+
See the
19+
[log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
20+
- id: logstream.name
21+
type: string
22+
brief: >
23+
The name of the AWS log stream an application is writing to.
24+
examples: ['logs/main/10838bed-421f-43ef-870a-f43feacbbb5b']
25+
- id: logstream.arn
26+
type: string
27+
brief: >
28+
The ARN of the AWS log stream.
29+
examples: ['arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b']
30+
note: >
31+
See the
32+
[log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
33+
One log group can contain several log streams, so this ARN necessarily identifies both a log
34+
group and a log stream.
Lines changed: 38 additions & 0 deletions
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 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
13+
type: string
14+
brief: >
15+
The name of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
16+
examples: ['opentelemetry-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+

specification/resource/semantic_conventions/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,9 @@ 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+
## 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). Provider-specific attributes all reside in the `cloud_provider` directory.

specification/resource/semantic_conventions/cloud.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@
1111
| `cloud.account.id` | string | The cloud account ID used to identify different entities. | `opentelemetry` | No |
1212
| `cloud.region` | string | A specific geographical location where different entities can run. | `us-central1` | No |
1313
| `cloud.zone` | string | Zones are a sub set of the region connected through low-latency links. [1] | `us-central1-a` | No |
14+
| `cloud.infrastructure.service` | string | Description of cloud resource in use. [2] | `AWS::EC2::Instance`<br>`Azure::Compute::VM`<br>`GCP::ComputeEngine::VM` | No |
1415

1516
**[1]:** In AWS, this is called availability-zone.
1617

18+
**[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 (::).
19+
1720
`cloud.provider` MUST be one of the following or, if none of the listed values apply, a custom value:
1821

1922
| Value | Description |
2023
|---|---|
2124
| `aws` | Amazon Web Services |
22-
| `azure` | Amazon Web Services |
25+
| `azure` | Microsoft Azure |
2326
| `gcp` | Google Cloud Platform |
2427
<!-- endsemconv -->
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# AWS
2+
3+
**Type:** `aws`
4+
5+
**Description:** Resources specific to Amazon Web Services.
6+
7+
<!-- semconv aws -->
8+
| Attribute | Type | Description | Example | Required |
9+
|---|---|---|---|---|
10+
| `aws.loggroup.name` | string | The name of the AWS log group an application is writing to. | `/aws/lambda/my-function`<br>`opentelemetry-service` | No |
11+
| `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 |
12+
| `aws.logstream.name` | string | The name of the AWS log stream an application is writing to. | `logs/main/10838bed-421f-43ef-870a-f43feacbbb5b` | No |
13+
| `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 |
14+
15+
**[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).
16+
17+
**[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.
18+
<!-- endsemconv -->
Lines changed: 22 additions & 0 deletions
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 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` | string | The name of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). | `opentelemetry-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 -->

0 commit comments

Comments
 (0)