Skip to content

[SVLS-8161] Update Azure Function metadata detection logic#7100

Merged
BridgeAR merged 5 commits intomasterfrom
kathie.huang/SVLS-8161/update-azure-function-metadata-logic
Dec 17, 2025
Merged

[SVLS-8161] Update Azure Function metadata detection logic#7100
BridgeAR merged 5 commits intomasterfrom
kathie.huang/SVLS-8161/update-azure-function-metadata-logic

Conversation

@kathiehuang
Copy link
Copy Markdown
Contributor

@kathiehuang kathiehuang commented Dec 12, 2025

What does this PR do?

If we're in an Azure Function on the flex consumption plan, set aas.resource.group to the DD_AZURE_RESOURCE_GROUP env var.

Motivation

  • We are currently adding support for profiling in Azure Functions, but the aas.resource.group tag in profiles for Node.js Azure Functions on the Flex Consumption Plan is currently being set to flex
    • This is because Flex Consumption functions don't have a WEBSITE_RESOURCE_GROUP env var, and the structure of the WEBSITE_OWNER_NAME env var is different from all other Azure Function hosting plans. As a result, we ask customers to manually set DD_AZURE_RESOURCE_GROUP as an app setting
  • Consistent with libdatadog changes made here
    • See related ticket here

Testing

  • Deployed a Flex Consumption function and saw the correct aas.resource.group
image

Deployed a Node.js Windows Web App with the site extension, a Linux Web App with sidecar, and a Azure Container App to make sure this doesn't affect their profile tags

How to test

  1. From this branch, run npm pack
  2. Move the newly created .tgz file to the root of your app directory
  3. Update package.json to have the tracer point to this file: "dd-trace": file:<name_of_tgz_file>
  4. If deploying a Windows Web App with the site extension, also add an env var NODE_PATH=C:\home\site\wwwroot\node_modules. If deploying apps using in-process, update the Dockerfile to also copy the .tgz file before it runs npm ci

…etadata for Azure Flex Consumption Functions
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.87%. Comparing base (e9493e1) to head (293e799).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7100      +/-   ##
==========================================
- Coverage   84.76%   83.87%   -0.90%     
==========================================
  Files         521      521              
  Lines       22151    22153       +2     
==========================================
- Hits        18776    18580     -196     
- Misses       3375     3573     +198     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 12, 2025

Overall package size

Self size: 4.34 MB
Deduped: 5.22 MB
No deduping: 5.22 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 1.15.0 | 127.66 kB | 856.24 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-official

This comment has been minimized.

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Dec 15, 2025

Benchmarks

Benchmark execution time: 2025-12-16 22:29:43

Comparing candidate commit 293e799 in PR branch kathie.huang/SVLS-8161/update-azure-function-metadata-logic with baseline commit e9493e1 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 290 metrics, 30 unstable metrics.

@DataDog DataDog deleted a comment from chatgpt-codex-connector Bot Dec 17, 2025
@kathiehuang
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@kathiehuang kathiehuang marked this pull request as ready for review December 17, 2025 15:18
@kathiehuang kathiehuang requested a review from a team as a code owner December 17, 2025 15:18
@BridgeAR BridgeAR merged commit 8f86699 into master Dec 17, 2025
793 checks passed
@BridgeAR BridgeAR deleted the kathie.huang/SVLS-8161/update-azure-function-metadata-logic branch December 17, 2025 22:29
dd-octo-sts Bot pushed a commit that referenced this pull request Dec 18, 2025
* Check DD_AZURE_RESOURCE_GROUP env var when detecting resource group metadata for Azure Flex Consumption Functions

* Add tests, add DD_AZURE_RESOURCE_GROUP to supported configurations

* Make flex consumption function detection a function
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Dec 18, 2025
nina9753 pushed a commit that referenced this pull request Dec 20, 2025
* Check DD_AZURE_RESOURCE_GROUP env var when detecting resource group metadata for Azure Flex Consumption Functions

* Add tests, add DD_AZURE_RESOURCE_GROUP to supported configurations

* Make flex consumption function detection a function
nina9753 pushed a commit that referenced this pull request Jan 15, 2026
* Check DD_AZURE_RESOURCE_GROUP env var when detecting resource group metadata for Azure Flex Consumption Functions

* Add tests, add DD_AZURE_RESOURCE_GROUP to supported configurations

* Make flex consumption function detection a function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants