Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .chloggen/add-azure-container-app-instance-id.yaml
Original file line number Diff line number Diff line change
@@ -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:
10 changes: 8 additions & 2 deletions docs/registry/attributes/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ This section defines generic attributes for Azure services.

| Key | Stability | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- |
| <a id="azure-container-app-instance-id" href="#azure-container-app-instance-id">`azure.container_app.instance.id`</a> | ![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` |
| <a id="azure-container-app-revision-name" href="#azure-container-app-revision-name">`azure.container_app.revision.name`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The name of the revision of an Azure Container App. [2] | `my-containerapp--20mh1s9` |
| <a id="azure-resource-group-name" href="#azure-resource-group-name">`azure.resource_group.name`</a> | ![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.
Expand All @@ -40,12 +46,12 @@ This section defines attributes for Azure Cosmos DB.
| --- | --- | --- | --- | --- |
| <a id="azure-cosmosdb-connection-mode" href="#azure-cosmosdb-connection-mode">`azure.cosmosdb.connection.mode`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | Cosmos client connection mode. | `gateway`; `direct` |
| <a id="azure-cosmosdb-consistency-level" href="#azure-cosmosdb-consistency-level">`azure.cosmosdb.consistency.level`</a> | ![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` |
| <a id="azure-cosmosdb-operation-contacted-regions" href="#azure-cosmosdb-operation-contacted-regions">`azure.cosmosdb.operation.contacted_regions`</a> | ![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"]` |
| <a id="azure-cosmosdb-operation-contacted-regions" href="#azure-cosmosdb-operation-contacted-regions">`azure.cosmosdb.operation.contacted_regions`</a> | ![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"]` |
| <a id="azure-cosmosdb-operation-request-charge" href="#azure-cosmosdb-operation-request-charge">`azure.cosmosdb.operation.request_charge`</a> | ![Development](https://img.shields.io/badge/-development-blue) | double | The number of request units consumed by the operation. | `46.18`; `1.0` |
| <a id="azure-cosmosdb-request-body-size" href="#azure-cosmosdb-request-body-size">`azure.cosmosdb.request.body.size`</a> | ![Development](https://img.shields.io/badge/-development-blue) | int | Request payload size in bytes. | |
| <a id="azure-cosmosdb-response-sub-status-code" href="#azure-cosmosdb-response-sub-status-code">`azure.cosmosdb.response.sub_status_code`</a> | ![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)

---

Expand Down
3 changes: 3 additions & 0 deletions docs/registry/entities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
36 changes: 36 additions & 0 deletions docs/registry/entities/azure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/entity_namespace.md.j2 -->

# Azure

## Azure Container App

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the generation title-cases the entity's name field directly

## {{ e.name | title_case | acronym | map_text("namespace_mapping") }}

and setting an explicit display name/title doesn't seem to be supported by the generator


**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.
1 change: 1 addition & 0 deletions docs/resource/cloud-provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
20 changes: 20 additions & 0 deletions docs/resource/cloud-provider/azure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--- Hugo front matter used to generate the website version of this page:
linkTitle: Azure
--->

# 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
54 changes: 54 additions & 0 deletions docs/resource/cloud-provider/azure/container-apps.md
Original file line number Diff line number Diff line change
@@ -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.

<!-- semconv entity.azure.container_app.instance -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**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.
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

<!-- semconv entity.azure.container_app -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**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.
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

Additionally, [the `cloud.provider` resource attribute MUST be set to `azure`](../../cloud.md).

[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
22 changes: 22 additions & 0 deletions model/azure/entities.yaml
Original file line number Diff line number Diff line change
@@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't require app replica IDs for jobs

For Azure Container Apps jobs, this required identity cannot be populated: Microsoft’s built-in environment-variable docs list CONTAINER_APP_REPLICA_NAME only for Apps, while Jobs expose job/execution variables instead. Since the new Azure page is scoped to resources running on Azure Container Apps, which also includes jobs, making this unconditionally required makes job telemetry non-conformant; please scope the entity to app replicas or make the requirement conditional/add job identity attributes.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarified that Azure Container Apps Jobs are out of scope in 2063e7b

20 changes: 20 additions & 0 deletions model/azure/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading