Skip to content

Add semantic conventions for Azure Container Apps replica name and revision id#3860

Open
kathiehuang wants to merge 13 commits into
open-telemetry:mainfrom
kathiehuang:add-azure-container-apps-replica-name-convention
Open

Add semantic conventions for Azure Container Apps replica name and revision id#3860
kathiehuang wants to merge 13 commits into
open-telemetry:mainfrom
kathiehuang:add-azure-container-apps-replica-name-convention

Conversation

@kathiehuang

@kathiehuang kathiehuang commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #3857

Changes

Adds two resource attributes and two entities for identifying Azure Container Apps resources:

  • azure.container_app.instance.id - the replica name of an Azure Container App
    • Identifying attribute of new azure.container_app.instance entity
  • azure.container_app.revision.name - the revision name of an Azure Container App
    • Identifying attribute of new azure.container_app entity

There is no semantic convention for the replica name of an Azure Container App. The Azure Container Apps resource detector needs a resource attribute to record this, but service.instance.id is not suitable: the Go SDK's default resource detector auto-populates service.instance.id with a random UUID, which would conflict with the detector's replica name value for Go users.

azure.container_app.instance.id avoids that collision, is more precise, and is consistent with the precedent set by the Node.js SDK's Azure resource detector.

The value should map to the CONTAINER_APP_REPLICA_NAME environment variable that Azure Container Apps injects into every replica.

This was raised during review of open-telemetry/opentelemetry-go-contrib#9208, which updates the Go SDK's Azure Container Apps resource detector to use this attribute instead of service.instance.id.

There also lacks a semantic convention for the name of an Azure Container App revision. This would be helpful for tracking Azure Container App versions. This value should map to CONTAINER_APP_REVISION.

Important

Pull request acceptance is subject to the triage process as described in Issue and PR Triage Management.
PRs that do not follow the guidance above may be automatically rejected and closed.

Merge requirement checklist

  • CONTRIBUTING.md guidelines followed.
  • Links to prototypes or existing instrumentations (when adding or changing conventions)
  • Disclose AI usage, see OTel GenAI policy:
    • no AI used
    • AI-assisted
    • bulk AI-generated
  • I have the experience and knowledge necessary to understand, review, and validate all content in this PR.1

Footnotes

  1. Yes, I can answer maintainer questions about the content of this PR without using AI.

@kathiehuang
kathiehuang marked this pull request as ready for review July 7, 2026 18:48
@kathiehuang
kathiehuang requested review from a team as code owners July 7, 2026 18:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eaf4a67aca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread model/azure/entities.yaml
attributes:
- ref: azure.container_app.instance.id
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

@Dipanshusinghh Dipanshusinghh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice changes! just a couple of minor things:

  • in model/azure/registry.yaml, should we add stability: development to the new registry.azure.container_apps group too? just to be consistent with other groups like cosmosdb.

  • since replicas scale under a specific revision, did you think about adding azure.container_app.revision (mapped to CONTAINER_APP_REVISION_NAME)? might be useful for tracking version of the app later on

Comment thread model/azure/entities.yaml
Comment on lines +2 to +5
- id: entity.azure.container_app
type: entity
stability: development
name: azure.container_app

@thompson-tomo thompson-tomo Jul 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would this be better as

Suggested change
- id: entity.azure.container_app
type: entity
stability: development
name: azure.container_app
- id: entity.azure.container_app.instance
type: entity
stability: development
name: azure.container_app.instance

Otherwise the impression is that it is describing the container_app rather than the instance.

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.

That makes sense! Updated in 678259d

Comment thread model/azure/registry.yaml Outdated
Comment on lines +40 to +55
- id: registry.azure.container_apps
type: attribute_group
display_name: Azure Container Apps Attributes
brief: >
This section defines attributes for Azure Container Apps. Does not apply to Azure Container Apps Jobs.
attributes:
- 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"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would lean towards not creating a new group but rather just use the general azure group as they won't be kept when switching to v2 and we have the entity.

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.

Gotcha - used the general azure group in 678259d

@thompson-tomo

Copy link
Copy Markdown
Contributor

since replicas scale under a specific revision, did you think about adding azure.container_app.revision (mapped to CONTAINER_APP_REVISION_NAME)? might be useful for tracking version of the app later on

This would reside on a seperate entity which is identified using this attribute and the name, just like done with the service entities.

…nce and fold azure.container_app.instance.id into general azure group
@kathiehuang

Copy link
Copy Markdown
Contributor Author

@Dipanshusinghh Thank you for the review!

  1. I removed the registry.azure.container_apps group to instead use the general azure group
  2. azure.container_app.revision sounds good to me, I agree it would be helpful to have! I can add it in this PR

@Dipanshusinghh

Copy link
Copy Markdown
Contributor

looks great just a quick heads up yamllint check is failing because changelog note line is >200 chars once u wrap/shorten it pr looks goods

Comment thread model/azure/entities.yaml Outdated
Comment on lines +13 to +22
- id: entity.azure.container_app.revision
type: entity
stability: development
name: azure.container_app.revision
brief: >
Resource used by a revision of an Azure Container App.
attributes:
- ref: azure.container_app.revision
role: identifying
requirement_level: required

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should be able to do

Suggested change
- id: entity.azure.container_app.revision
type: entity
stability: development
name: azure.container_app.revision
brief: >
Resource used by a revision of an Azure Container App.
attributes:
- ref: azure.container_app.revision
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.
attributes:
- ref: azure.container_app.revision
role: identifying
requirement_level: required

As it feels off having an attribute describing a property of an object where that object is named the same thing.

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.

Does that reopen the ambiguity we fixed earlier where the azure.container_app entity reads as the whole Container App app resource, not just the revision? Maybe we could use azure.container_app.revision.id or azure.container_app.revision.name as the identifying attribute of azure.container_app.revision?

  - id: entity.azure.container_app.revision
    type: entity
    stability: development
    name: azure.container_app.revision
    brief: >
      Resource used by a revision of an Azure Container App.
    attributes:
      - ref: azure.container_app.revision.id
        role: identifying
        requirement_level: required

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like to think of it much like service. For instance you might have 1 app with many instances with each app sharing the same revision, when a new version is released the instances will switch to the new one but you still want to know about the old entity.

Hence i think it is ok. however it could be azure.container_app.app.* to be fully unambiguous, with the attributes also renamed. Ideally we could've just used app.id etc but that is harder to get approved.

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.

Sounds good, I can update to entity.azure.container_app once the PR is reopened. But I'm also wondering if the actual stable identifier for an Azure Container App entity would be its name (CONTAINER_APP_NAME -> service.name)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It could be either & i have no strong opinion as never used azure container apps.

My thought would be to go with what is most consistent after checking k8's etc.

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 most objects that have a real platform-issued UID (pod, deployment, node, etc.) mark .name as descriptive (e.g. k8s pods, nodes). Some other entities without a UID use .name as the identifying attribute (namespace, service, gcp.gce.instance_group_manager)

AWS ECS and GCP Cloud Run both don't mark any attribute as role:identifying, and aws.ecs.task.revision is requirement_level: recommended without any role. I think for this PR's scope I'll drop role: identifying and requirement_level: required from azure.container_app.revision on entity.azure.container_app and update the brief to Resource used by Azure Container Apps

Azure Container Apps doesn't expose an UID via env vars - I'd say the closest unique identifier is the resource ID (a composite string similar to AWS ARNs) but that cannot be derived from a single env var (and there are no env vars for resource groups/subscription ids in Azure Container Apps anyway).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

makes total sense to drop the identifying role since there's no platform UID, same as ecs/run hope we can get this reopened via CNCF slack soon, looks ready!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The reason they don't have a role is because they are legacy in fact any entity stability level other than dev requires a role, hence i would be setting it to name in this pr. We can always refine it as part of stability works later.

@kathiehuang kathiehuang Jul 14, 2026

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.

Thinking over it, I think it makes sense for azure.container_app.revision to be the identifying attribute of the Azure Container App entity since the container app name can be derived from the revision name (it doesn't seem like container apps can have consecutive hyphens in their name, so revision names can be parsed as <container-app-name>--<revision-suffix>, and an app name wouldn't add any disambiguating information beyond what revision already encodes.

@trask Would you be able to take a look at this PR? My changes aren't showing up because it's closed. Thank you so much!

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

👋 Thanks for your contribution!

This PR modifies file(s) in area(s) that do not currently have an active SIG/project:

  • azure

Per the area ownership process,
changes to these areas need an active SIG/project, so this PR has been automatically
closed and labeled triage:rejected:declined.

This does not mean your change is unwelcome:

  • For substantial changes or new conventions: Consider starting a new SIG/project.
    See the Project Management guide.
  • If you believe this was closed in error: Please reach out in the
    #otel-semantic-conventions channel on the CNCF Slack.

Thanks again for taking the time to contribute! 🙏

@github-actions github-actions Bot closed this Jul 8, 2026
@kathiehuang kathiehuang changed the title Add semantic conventions for Azure Container Apps replica name Add semantic conventions for Azure Container Apps replica name and revision id Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

👋 Thanks for your contribution!

This PR modifies file(s) in area(s) that do not currently have an active SIG/project:

  • azure

Per the area ownership process,
changes to these areas need an active SIG/project, so this PR has been automatically
closed and labeled triage:rejected:declined.

This does not mean your change is unwelcome:

  • For substantial changes or new conventions: Consider starting a new SIG/project.
    See the Project Management guide.
  • If you believe this was closed in error: Please reach out in the
    #otel-semantic-conventions channel on the CNCF Slack.

Thanks again for taking the time to contribute! 🙏

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

👋 Thanks for your contribution!

This PR modifies file(s) in area(s) that do not currently have an active SIG/project:

  • azure

Per the area ownership process,
changes to these areas need an active SIG/project, so this PR has been automatically
closed and labeled triage:rejected:declined.

This does not mean your change is unwelcome:

  • For substantial changes or new conventions: Consider starting a new SIG/project.
    See the Project Management guide.
  • If you believe this was closed in error: Please reach out in the
    #otel-semantic-conventions channel on the CNCF Slack.

Thanks again for taking the time to contribute! 🙏

@trask trask reopened this Jul 20, 2026
@jsuereth jsuereth moved this from Untriaged to Awaiting codeowners approval in Semantic Conventions Triage Jul 20, 2026
Copilot AI review requested due to automatic review settings July 20, 2026 16:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds semantic conventions to identify Azure Container Apps replicas and revisions via new Azure attribute keys and entity definitions.

Changes:

  • Added azure.container_app.instance.id and azure.container_app.revision Azure resource attributes.
  • Introduced azure.container_app.instance and azure.container_app entities using those identifying attributes.
  • Published corresponding generated documentation and linked it from the cloud-provider docs index.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
model/azure/registry.yaml Defines the two new Azure attribute keys for Container Apps replica + revision identification.
model/azure/entities.yaml Adds two new entities backed by the new identifying attributes.
docs/resource/cloud-provider/azure.md New user-facing resource semantic conventions doc for Azure Container Apps entities.
docs/resource/cloud-provider/README.md Adds an Azure entry pointing to the new Azure Container Apps doc.
docs/registry/entities/azure.md Generated entity reference page for the new Azure entities.
docs/registry/entities/README.md Adds Azure namespace + entity entries to the entities index.
docs/registry/attributes/azure.md Generated attribute reference entries for the new keys (and adjusts footnotes).
.chloggen/add-azure-container-app-instance-id.yaml Changelog entry describing the new entities/attributes.

Comment thread model/azure/registry.yaml Outdated
Comment on lines +26 to +30
- id: azure.container_app.revision
type: string
stability: development
brief: >
The name of the revision of an 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.

That makes sense, updated to azure.container_app.revision.name in 1d19c64

Comment thread docs/resource/cloud-provider/README.md Outdated
This document defines semantic conventions for resource cloud providers.

* [AWS](aws/README.md): Semantic Conventions for Amazon Web Services.
* [Azure](azure.md): Semantic Conventions for Azure.

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.

Created an azure/README.md page and linked to it in cloud-provider/README.md 6d57de3. The Azure Container Apps page is now linked in azure/README.md


# 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

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 21, 2026

Copy link
Copy Markdown

Pull request dashboard status

Status last refreshed: 2026-07-25 14:01:44 UTC.

  • Waiting on: Reviewers
  • Next step: Review the latest changes.

This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Awaiting codeowners approval

Development

Successfully merging this pull request may close these issues.

Add support for Azure Container Apps replica instance ID

7 participants