diff --git a/.chloggen/add-azure-container-app-instance-id.yaml b/.chloggen/add-azure-container-app-instance-id.yaml new file mode 100644 index 0000000000..d38ce6958d --- /dev/null +++ b/.chloggen/add-azure-container-app-instance-id.yaml @@ -0,0 +1,12 @@ +change_type: enhancement + +component: azure + +note: > + Add `azure.container_app.instance` and `azure.container_app` entities, and + `azure.container_app.instance.id` and `azure.container_app.revision.name` attributes, for + identifying replicas and revisions of an Azure Container App. + +issues: [3857] + +subtext: diff --git a/docs/registry/attributes/azure.md b/docs/registry/attributes/azure.md index 1e23cd5fa2..ac15e84fd1 100644 --- a/docs/registry/attributes/azure.md +++ b/docs/registry/attributes/azure.md @@ -16,8 +16,14 @@ This section defines generic attributes for Azure services. | Key | Stability | Value Type | Description | Example Values | | --- | --- | --- | --- | --- | +| `azure.container_app.instance.id` | ![Development](https://img.shields.io/badge/-development-blue) | string | The name of the replica of an Azure Container App. [1] | `my-containerapp--20mh1s9-86c8c4b497-zx9bq` | +| `azure.container_app.revision.name` | ![Development](https://img.shields.io/badge/-development-blue) | string | The name of the revision of an Azure Container App. [2] | `my-containerapp--20mh1s9` | | `azure.resource_group.name` | ![Development](https://img.shields.io/badge/-development-blue) | string | The name of the Azure [resource group](https://learn.microsoft.com/azure/azure-resource-manager/management/manage-resource-groups-portal) the resource belongs to. | `my-resource-group`; `rg-myapp-prod` | +**[1] `azure.container_app.instance.id`:** The value should be set to the [`CONTAINER_APP_REPLICA_NAME`](https://learn.microsoft.com/azure/container-apps/environment-variables) environment variable. + +**[2] `azure.container_app.revision.name`:** The value should be set to the [`CONTAINER_APP_REVISION`](https://learn.microsoft.com/azure/container-apps/environment-variables) environment variable. + ## Azure Client Library Attributes This section defines generic attributes used by Azure Client Libraries. @@ -40,12 +46,12 @@ This section defines attributes for Azure Cosmos DB. | --- | --- | --- | --- | --- | | `azure.cosmosdb.connection.mode` | ![Development](https://img.shields.io/badge/-development-blue) | string | Cosmos client connection mode. | `gateway`; `direct` | | `azure.cosmosdb.consistency.level` | ![Development](https://img.shields.io/badge/-development-blue) | string | Account or request [consistency level](https://learn.microsoft.com/azure/cosmos-db/consistency-levels). | `Eventual`; `ConsistentPrefix`; `BoundedStaleness`; `Strong`; `Session` | -| `azure.cosmosdb.operation.contacted_regions` | ![Development](https://img.shields.io/badge/-development-blue) | string[] | List of regions contacted during operation in the order that they were contacted. If there is more than one region listed, it indicates that the operation was performed on multiple regions i.e. cross-regional call. [1] | `["North Central US", "Australia East", "Australia Southeast"]` | +| `azure.cosmosdb.operation.contacted_regions` | ![Development](https://img.shields.io/badge/-development-blue) | string[] | List of regions contacted during operation in the order that they were contacted. If there is more than one region listed, it indicates that the operation was performed on multiple regions i.e. cross-regional call. [3] | `["North Central US", "Australia East", "Australia Southeast"]` | | `azure.cosmosdb.operation.request_charge` | ![Development](https://img.shields.io/badge/-development-blue) | double | The number of request units consumed by the operation. | `46.18`; `1.0` | | `azure.cosmosdb.request.body.size` | ![Development](https://img.shields.io/badge/-development-blue) | int | Request payload size in bytes. | | | `azure.cosmosdb.response.sub_status_code` | ![Development](https://img.shields.io/badge/-development-blue) | int | Cosmos DB sub status code. | `1000`; `1002` | -**[1] `azure.cosmosdb.operation.contacted_regions`:** Region name matches the format of `displayName` in [Azure Location API](https://learn.microsoft.com/rest/api/resources/subscriptions/list-locations) +**[3] `azure.cosmosdb.operation.contacted_regions`:** Region name matches the format of `displayName` in [Azure Location API](https://learn.microsoft.com/rest/api/resources/subscriptions/list-locations) --- diff --git a/docs/registry/entities/README.md b/docs/registry/entities/README.md index 21d8fa5f7d..9d6355fa7f 100644 --- a/docs/registry/entities/README.md +++ b/docs/registry/entities/README.md @@ -27,6 +27,9 @@ Currently, the following namespaces exist: | | [aws.ecs](aws.md#aws-ecs) | ![Development](https://img.shields.io/badge/-development-blue) | | | [aws.eks](aws.md#aws-eks) | ![Development](https://img.shields.io/badge/-development-blue) | | | [aws.log](aws.md#aws-log) | ![Development](https://img.shields.io/badge/-development-blue) | +| Azure | | | +| | [azure.container_app](azure.md#azure-container-app) | ![Development](https://img.shields.io/badge/-development-blue) | +| | [azure.container_app.instance](azure.md#azure-container-app-instance) | ![Development](https://img.shields.io/badge/-development-blue) | | Browser | | | | | [browser](browser.md#browser) | ![Development](https://img.shields.io/badge/-development-blue) | | | [browser.document](browser.md#browser-document) | ![Development](https://img.shields.io/badge/-development-blue) | diff --git a/docs/registry/entities/azure.md b/docs/registry/entities/azure.md new file mode 100644 index 0000000000..6afa143011 --- /dev/null +++ b/docs/registry/entities/azure.md @@ -0,0 +1,36 @@ + + + +# Azure + +## Azure Container App + +**Status:** ![Development](https://img.shields.io/badge/-development-blue) + +**type:** `azure.container_app` + +**Description:** Resource used by a revision of an Azure Container App. Does not apply to Azure Container Apps Jobs. + +**Attributes:** + +| Role | Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | +| --- | --- | --- | --- | --- | --- | --- | +| Identity | [`azure.container_app.revision.name`](/docs/registry/attributes/azure.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | The name of the revision of an Azure Container App. [1] | `my-containerapp--20mh1s9` | + +**[1] `azure.container_app.revision.name`:** The value should be set to the [`CONTAINER_APP_REVISION`](https://learn.microsoft.com/azure/container-apps/environment-variables) environment variable. + +## Azure Container App Instance + +**Status:** ![Development](https://img.shields.io/badge/-development-blue) + +**type:** `azure.container_app.instance` + +**Description:** Resource used by an Azure Container App replica. + +**Attributes:** + +| Role | Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | +| --- | --- | --- | --- | --- | --- | --- | +| Identity | [`azure.container_app.instance.id`](/docs/registry/attributes/azure.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | The name of the replica of an Azure Container App. [2] | `my-containerapp--20mh1s9-86c8c4b497-zx9bq` | + +**[2] `azure.container_app.instance.id`:** The value should be set to the [`CONTAINER_APP_REPLICA_NAME`](https://learn.microsoft.com/azure/container-apps/environment-variables) environment variable. diff --git a/docs/resource/cloud-provider/README.md b/docs/resource/cloud-provider/README.md index 1525e63e33..490a81611a 100644 --- a/docs/resource/cloud-provider/README.md +++ b/docs/resource/cloud-provider/README.md @@ -5,6 +5,7 @@ This document defines semantic conventions for resource cloud providers. * [AWS](aws/README.md): Semantic Conventions for Amazon Web Services. +* [Azure](azure/README.md): Semantic Conventions for Azure. * [GCP](gcp/README.md): Semantic Conventions for Google Cloud Platform. * [Heroku](heroku.md): Semantic Conventions for Heroku. diff --git a/docs/resource/cloud-provider/azure/README.md b/docs/resource/cloud-provider/azure/README.md new file mode 100644 index 0000000000..d09290a9af --- /dev/null +++ b/docs/resource/cloud-provider/azure/README.md @@ -0,0 +1,20 @@ + + +# Azure semantic conventions + +**Status**: [Development][DocumentStatus] + +This directory defines standards for resource attributes that only apply to +Azure resources. If an attribute could apply to resources from more than one +cloud provider (like account ID, operating system, etc), it belongs in the +parent `model` directory. + +## Services + +Attributes that relate to an individual Azure service: + +- [Container Apps](./container-apps.md) + +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/resource/cloud-provider/azure/container-apps.md b/docs/resource/cloud-provider/azure/container-apps.md new file mode 100644 index 0000000000..abd36a37e0 --- /dev/null +++ b/docs/resource/cloud-provider/azure/container-apps.md @@ -0,0 +1,54 @@ +# Azure Container Apps + +**Status**: [Development][DocumentStatus] + +These conventions are recommended for resources running on +[Azure Container Apps](https://learn.microsoft.com/azure/container-apps/overview). They do not apply to Azure Container Apps Jobs. + + + + + + +**Status:** ![Development](https://img.shields.io/badge/-development-blue) + +**type:** `azure.container_app.instance` + +**Description:** Resource used by an Azure Container App replica. + +**Attributes:** + +| Role | Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | +| --- | --- | --- | --- | --- | --- | --- | +| Identity | [`azure.container_app.instance.id`](/docs/registry/attributes/azure.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | The name of the replica of an Azure Container App. [1] | `my-containerapp--20mh1s9-86c8c4b497-zx9bq` | + +**[1] `azure.container_app.instance.id`:** The value should be set to the [`CONTAINER_APP_REPLICA_NAME`](https://learn.microsoft.com/azure/container-apps/environment-variables) environment variable. + + + + + + + + + +**Status:** ![Development](https://img.shields.io/badge/-development-blue) + +**type:** `azure.container_app` + +**Description:** Resource used by a revision of an Azure Container App. Does not apply to Azure Container Apps Jobs. + +**Attributes:** + +| Role | Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | +| --- | --- | --- | --- | --- | --- | --- | +| Identity | [`azure.container_app.revision.name`](/docs/registry/attributes/azure.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | The name of the revision of an Azure Container App. [1] | `my-containerapp--20mh1s9` | + +**[1] `azure.container_app.revision.name`:** The value should be set to the [`CONTAINER_APP_REVISION`](https://learn.microsoft.com/azure/container-apps/environment-variables) environment variable. + + + + +Additionally, [the `cloud.provider` resource attribute MUST be set to `azure`](../../cloud.md). + +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/model/azure/entities.yaml b/model/azure/entities.yaml new file mode 100644 index 0000000000..90d4fa92db --- /dev/null +++ b/model/azure/entities.yaml @@ -0,0 +1,22 @@ +groups: + - id: entity.azure.container_app.instance + type: entity + stability: development + name: azure.container_app.instance + brief: > + Resource used by an Azure Container App replica. + attributes: + - ref: azure.container_app.instance.id + role: identifying + requirement_level: required + + - id: entity.azure.container_app + type: entity + stability: development + name: azure.container_app + brief: > + Resource used by a revision of an Azure Container App. Does not apply to Azure Container Apps Jobs. + attributes: + - ref: azure.container_app.revision.name + role: identifying + requirement_level: required diff --git a/model/azure/registry.yaml b/model/azure/registry.yaml index aebfe1d3e3..f082cd7125 100644 --- a/model/azure/registry.yaml +++ b/model/azure/registry.yaml @@ -13,6 +13,26 @@ groups: [resource group](https://learn.microsoft.com/azure/azure-resource-manager/management/manage-resource-groups-portal) the resource belongs to. examples: ["my-resource-group", "rg-myapp-prod"] + - id: azure.container_app.instance.id + type: string + stability: development + brief: > + The name of the replica of an Azure Container App. + note: > + The value should be set to the + [`CONTAINER_APP_REPLICA_NAME`](https://learn.microsoft.com/azure/container-apps/environment-variables) + environment variable. + examples: ["my-containerapp--20mh1s9-86c8c4b497-zx9bq"] + - id: azure.container_app.revision.name + type: string + stability: development + brief: > + The name of the revision of an Azure Container App. + note: > + The value should be set to the + [`CONTAINER_APP_REVISION`](https://learn.microsoft.com/azure/container-apps/environment-variables) + environment variable. + examples: ["my-containerapp--20mh1s9"] - id: registry.azure.client.sdk type: attribute_group display_name: Azure Client Library Attributes