dd-trace-js icon indicating copy to clipboard operation
dd-trace-js copied to clipboard

[SVLS-8161] Update Azure Function metadata detection logic

Open kathiehuang opened this issue 1 week ago • 2 comments

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

Additional Notes

TODO: Test across all Node.js Azure products (ACA, AAS) to make sure this doesn't affect their profile tags

kathiehuang avatar Dec 12 '25 21:12 kathiehuang

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 83.87%. Comparing base (e9493e1) to head (293e799). :warning: 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     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Dec 12 '25 21:12 codecov[bot]

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

github-actions[bot] avatar Dec 12 '25 21:12 github-actions[bot]

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 293e799 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

datadog-official[bot] avatar Dec 15 '25 20:12 datadog-official[bot]

Benchmarks

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

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

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

pr-commenter[bot] avatar Dec 15 '25 21:12 pr-commenter[bot]

@codex review

kathiehuang avatar Dec 17 '25 15:12 kathiehuang