Skip to content

Add New Azure Functions OpenTelemetry Attributes - #3514

Open
E. Lewis (Lewis-E) wants to merge 1 commit into
Azure:mainfrom
Lewis-E:lewis/functions-resource-identity
Open

E. Lewis (Lewis-E) wants to merge 1 commit into
Azure:mainfrom
Lewis-E:lewis/functions-resource-identity

Conversation

@Lewis-E

@Lewis-E E. Lewis (Lewis-E) commented Sep 24, 2026 •

Copy link
Copy Markdown

Issue describing the changes in this PR

Adds:

  • cloud.account.id from the subscription portion of WEBSITE_OWNER_NAME, reusing the existing resource-ID parsing behavior.
  • azure.resource_group.name from WEBSITE_RESOURCE_GROUP.
  • faas.instance from the first non-empty value of WEBSITE_INSTANCE_ID, WEBSITE_POD_NAME, or CONTAINER_NAME, in that order.
    Missing values are omitted; the detector does not infer a resource group or generate an instance ID.

No open issue. PR opened based on Rohit Ranjan (@RohitRanjanMS) 's recommendation on opentelemetry-dotnet-contrib#5165.

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

Additional information

Tested with dedicated & flex live test apps and saw the expected properties.

Related changes being discussed at Microsoft re: Node & Python SDKs: open-telemetry/opentelemetry-python-contrib#5007 (comment)

AI disclosure: Pi Coding Agent was used to draft this PR.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@Lewis-E

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Datadog"

@Lewis-E
E. Lewis (Lewis-E) marked this pull request as ready for review September 24, 2026 19:58
Copilot AI lite review requested due to automatic review settings September 24, 2026 19:58

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.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Adds Azure Functions OpenTelemetry resource attributes for subscription, resource group, and instance identity.

Changes:

  • Detects new semantic convention attributes from Azure environment variables.
  • Preserves explicit OTEL_RESOURCE_ATTRIBUTES values.
  • Adds constants, documentation, release notes, and test coverage.
File Description
test/​DotNetWorker.OpenTelemetry.Tests/​EndToEndTests.cs Tests detection, fallback, and precedence behavior.
src/​DotNetWorker.OpenTelemetry/​ResourceSemanticConventions.cs Defines new attribute names.
src/​DotNetWorker.OpenTelemetry/​release_notes.md Records the new functionality.
src/​DotNetWorker.OpenTelemetry/​README.md Documents attribute sources and behavior.
src/​DotNetWorker.OpenTelemetry/​OpenTelemetryConstants.cs Defines related environment variable constants.
src/​DotNetWorker.OpenTelemetry/​FunctionsResourceDetector.cs Implements attribute detection and precedence handling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants