Skip to content

Commit ed054bc

Browse files
Move cloud attributes to the registry (#453)
Co-authored-by: Alexander Wert <[email protected]>
1 parent a2bbcc3 commit ed054bc

File tree

7 files changed

+280
-181
lines changed

7 files changed

+280
-181
lines changed

docs/attributes-registry/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ All registered attributes are listed by namespace in this registry.
2727
2828
Currently, the following namespaces exist:
2929

30+
* [Cloud](cloud.md)
3031
* [Code](code.md)
3132
* [Container](container.md)
3233
* [HTTP](http.md)

docs/attributes-registry/cloud.md

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<!--- Hugo front matter used to generate the website version of this page:
2+
--->
3+
4+
# Cloud
5+
6+
## Cloud Attributes
7+
8+
<!-- semconv registry.cloud(omit_requirement_level) -->
9+
| Attribute | Type | Description | Examples |
10+
|---|---|---|---|
11+
| `cloud.account.id` | string | The cloud account ID the resource is assigned to. | `111111111111`; `opentelemetry` |
12+
| `cloud.availability_zone` | string | Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. [1] | `us-east-1c` |
13+
| `cloud.platform` | string | The cloud platform in use. [2] | `alibaba_cloud_ecs` |
14+
| `cloud.provider` | string | Name of the cloud provider. | `alibaba_cloud` |
15+
| `cloud.region` | string | The geographical region the resource is running. [3] | `us-central1`; `us-east-1` |
16+
| `cloud.resource_id` | string | Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP) [4] | `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function`; `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID`; `/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>` |
17+
18+
**[1]:** Availability zones are called "zones" on Alibaba Cloud and Google Cloud.
19+
20+
**[2]:** The prefix of the service SHOULD match the one specified in `cloud.provider`.
21+
22+
**[3]:** Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).
23+
24+
**[4]:** On some cloud providers, it may not be possible to determine the full ID at startup,
25+
so it may be necessary to set `cloud.resource_id` as a span attribute instead.
26+
27+
The exact value to use for `cloud.resource_id` depends on the cloud provider.
28+
The following well-known definitions MUST be used if you set this attribute and they apply:
29+
30+
* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
31+
Take care not to use the "invoked ARN" directly but replace any
32+
[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
33+
with the resolved function version, as the same runtime instance may be invokable with
34+
multiple different aliases.
35+
* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
36+
* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function,
37+
*not* the function app, having the form
38+
`/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`.
39+
This means that a span attribute MUST be used, as an Azure function app can host multiple functions that would usually share
40+
a TracerProvider.
41+
42+
`cloud.platform` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used.
43+
44+
| Value | Description |
45+
|---|---|
46+
| `alibaba_cloud_ecs` | Alibaba Cloud Elastic Compute Service |
47+
| `alibaba_cloud_fc` | Alibaba Cloud Function Compute |
48+
| `alibaba_cloud_openshift` | Red Hat OpenShift on Alibaba Cloud |
49+
| `aws_ec2` | AWS Elastic Compute Cloud |
50+
| `aws_ecs` | AWS Elastic Container Service |
51+
| `aws_eks` | AWS Elastic Kubernetes Service |
52+
| `aws_lambda` | AWS Lambda |
53+
| `aws_elastic_beanstalk` | AWS Elastic Beanstalk |
54+
| `aws_app_runner` | AWS App Runner |
55+
| `aws_openshift` | Red Hat OpenShift on AWS (ROSA) |
56+
| `azure_vm` | Azure Virtual Machines |
57+
| `azure_container_instances` | Azure Container Instances |
58+
| `azure_aks` | Azure Kubernetes Service |
59+
| `azure_functions` | Azure Functions |
60+
| `azure_app_service` | Azure App Service |
61+
| `azure_openshift` | Azure Red Hat OpenShift |
62+
| `gcp_bare_metal_solution` | Google Bare Metal Solution (BMS) |
63+
| `gcp_compute_engine` | Google Cloud Compute Engine (GCE) |
64+
| `gcp_cloud_run` | Google Cloud Run |
65+
| `gcp_kubernetes_engine` | Google Cloud Kubernetes Engine (GKE) |
66+
| `gcp_cloud_functions` | Google Cloud Functions (GCF) |
67+
| `gcp_app_engine` | Google Cloud App Engine (GAE) |
68+
| `gcp_openshift` | Red Hat OpenShift on Google Cloud |
69+
| `ibm_cloud_openshift` | Red Hat OpenShift on IBM Cloud |
70+
| `tencent_cloud_cvm` | Tencent Cloud Cloud Virtual Machine (CVM) |
71+
| `tencent_cloud_eks` | Tencent Cloud Elastic Kubernetes Service (EKS) |
72+
| `tencent_cloud_scf` | Tencent Cloud Serverless Cloud Function (SCF) |
73+
74+
`cloud.provider` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used.
75+
76+
| Value | Description |
77+
|---|---|
78+
| `alibaba_cloud` | Alibaba Cloud |
79+
| `aws` | Amazon Web Services |
80+
| `azure` | Microsoft Azure |
81+
| `gcp` | Google Cloud Platform |
82+
| `heroku` | Heroku Platform as a Service |
83+
| `ibm_cloud` | IBM Cloud |
84+
| `tencent_cloud` | Tencent Cloud |
85+
<!-- endsemconv -->

docs/faas/faas-spans.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ If Spans following this convention are produced, a Resource of type `faas` MUST
4141
<!-- semconv faas_span(full) -->
4242
| Attribute | Type | Description | Examples | Requirement Level |
4343
|---|---|---|---|---|
44-
| [`cloud.resource_id`](../resource/cloud.md) | string | Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP) [1] | `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function`; `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID`; `/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>` | Recommended |
44+
| [`cloud.resource_id`](../attributes-registry/cloud.md) | string | Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP) [1] | `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function`; `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID`; `/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>` | Recommended |
4545
| `faas.invocation_id` | string | The invocation ID of the current function invocation. | `af9d5aa4-a685-4c5f-a22b-444f80b3cc28` | Recommended |
4646
| `faas.trigger` | string | Type of the trigger which caused this function invocation. [2] | `datasource` | Recommended |
4747

docs/resource/cloud.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
**Description:** A cloud infrastructure (e.g. GCP, Azure, AWS).
88

9-
<!-- semconv cloud -->
9+
<!-- semconv cloud(full) -->
1010
| Attribute | Type | Description | Examples | Requirement Level |
1111
|---|---|---|---|---|
12-
| `cloud.account.id` | string | The cloud account ID the resource is assigned to. | `111111111111`; `opentelemetry` | Recommended |
13-
| `cloud.availability_zone` | string | Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. [1] | `us-east-1c` | Recommended |
14-
| `cloud.platform` | string | The cloud platform in use. [2] | `alibaba_cloud_ecs` | Recommended |
15-
| `cloud.provider` | string | Name of the cloud provider. | `alibaba_cloud` | Recommended |
16-
| `cloud.region` | string | The geographical region the resource is running. [3] | `us-central1`; `us-east-1` | Recommended |
17-
| `cloud.resource_id` | string | Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP) [4] | `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function`; `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID`; `/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>` | Recommended |
12+
| [`cloud.account.id`](../attributes-registry/cloud.md) | string | The cloud account ID the resource is assigned to. | `111111111111`; `opentelemetry` | Recommended |
13+
| [`cloud.availability_zone`](../attributes-registry/cloud.md) | string | Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. [1] | `us-east-1c` | Recommended |
14+
| [`cloud.platform`](../attributes-registry/cloud.md) | string | The cloud platform in use. [2] | `alibaba_cloud_ecs` | Recommended |
15+
| [`cloud.provider`](../attributes-registry/cloud.md) | string | Name of the cloud provider. | `alibaba_cloud` | Recommended |
16+
| [`cloud.region`](../attributes-registry/cloud.md) | string | The geographical region the resource is running. [3] | `us-central1`; `us-east-1` | Recommended |
17+
| [`cloud.resource_id`](../attributes-registry/cloud.md) | string | Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP) [4] | `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function`; `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID`; `/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>` | Recommended |
1818

1919
**[1]:** Availability zones are called "zones" on Alibaba Cloud and Google Cloud.
2020

docs/resource/faas.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ See also:
1616
<!-- semconv faas_resource -->
1717
| Attribute | Type | Description | Examples | Requirement Level |
1818
|---|---|---|---|---|
19-
| [`cloud.resource_id`](cloud.md) | string | Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP) [1] | `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function`; `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID`; `/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>` | Recommended |
19+
| [`cloud.resource_id`](../attributes-registry/cloud.md) | string | Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP) [1] | `arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function`; `//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID`; `/subscriptions/<SUBSCIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>` | Recommended |
2020
| `faas.instance` | string | The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. [2] | `2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de` | Recommended |
2121
| `faas.max_memory` | int | The amount of memory available to the serverless function converted to Bytes. [3] | `134217728` | Recommended |
2222
| `faas.name` | string | The name of the single function that this runtime instance executes. [4] | `my-function`; `myazurefunctionapp/some-function-name` | Required |

0 commit comments

Comments
 (0)