Skip to content

feat(azure_functions): add messaging attributes to azure function service bus consumer spans #13810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

duncanpharvey
Copy link
Contributor

@duncanpharvey duncanpharvey commented Jun 27, 2025

This PR adds messaging attributes to spans generated by Azure Function Service Bus Triggers. It also updates the minimum supported Azure Function version to 1.10.1 since that's when the FunctionApp class that is used to patch a user's functions was introduced.

Instrumentation details:

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

Copy link
Contributor

github-actions bot commented Jun 27, 2025

CODEOWNERS have been resolved as:

releasenotes/notes/feat-azure-functions-service-bus-trigger-span-attributes-6de4b04663074cdb.yaml  @DataDog/apm-python
.riot/requirements/16ae446.txt                                          @DataDog/apm-python
.riot/requirements/5b956b7.txt                                          @DataDog/apm-python
.riot/requirements/6c15ef8.txt                                          @DataDog/apm-python
.riot/requirements/a1026b8.txt                                          @DataDog/apm-python
ddtrace/_trace/trace_handlers.py                                        @DataDog/apm-sdk-api-python
ddtrace/contrib/integration_registry/registry.yaml                      @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/azure_functions/patch.py                       @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/internal/constants.py                                           @DataDog/apm-core-python
docs/index.rst                                                          @DataDog/python-guild
riotfile.py                                                             @DataDog/apm-python
supported_versions_output.json                                          @DataDog/apm-core-python
supported_versions_table.csv                                            @DataDog/apm-core-python
tests/contrib/azure_functions/azure_function_app/function_app.py        @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/azure_functions/test_azure_functions_snapshot.py          @DataDog/apm-core-python @DataDog/apm-idm-python
tests/snapshots/tests.contrib.azure_functions.test_azure_functions_snapshot.test_service_bus_distributed_tracing[disabled].json  @DataDog/apm-python
tests/snapshots/tests.contrib.azure_functions.test_azure_functions_snapshot.test_service_bus_distributed_tracing[enabled].json  @DataDog/apm-python
.riot/requirements/18d52a7.txt                                          @DataDog/apm-python
.riot/requirements/5b1bf57.txt                                          @DataDog/apm-python
.riot/requirements/846ba1d.txt                                          @DataDog/apm-python
.riot/requirements/ce8d896.txt                                          @DataDog/apm-python

Copy link
Contributor

github-actions bot commented Jun 27, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 284 ± 4 ms.

The average import time from base is: 284 ± 3 ms.

The import time difference between this PR and base is: 0.5 ± 0.2 ms.

Import time breakdown

The following import paths have grown:

ddtrace.auto 0.161 ms (0.06%)
ddtrace.bootstrap.sitecustomize 0.161 ms (0.06%)
ddtrace._trace.trace_handlers 0.091 ms (0.03%)
ddtrace.ext.db 0.091 ms (0.03%)
ddtrace.contrib.internal.subprocess.constants 0.070 ms (0.02%)

The following import paths have shrunk:

ddtrace.auto 1.838 ms (0.65%)
ddtrace.bootstrap.sitecustomize 1.163 ms (0.41%)
ddtrace.bootstrap.preload 1.103 ms (0.39%)
ddtrace.internal.remoteconfig.client 0.606 ms (0.21%)
ddtrace._trace.trace_handlers 0.060 ms (0.02%)
ddtrace 0.675 ms (0.24%)
ddtrace.internal._unpatched 0.031 ms (0.01%)
json 0.031 ms (0.01%)
json.decoder 0.031 ms (0.01%)
re 0.031 ms (0.01%)
enum 0.031 ms (0.01%)
types 0.031 ms (0.01%)

@pr-commenter
Copy link

pr-commenter bot commented Jun 27, 2025

Benchmarks

Benchmark execution time: 2025-07-01 16:28:37

Comparing candidate commit 6ea87fa in PR branch duncan-harvey/azure-functions-servicebus-consumer-span-attributes with baseline commit f4ac9fd in branch main.

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

@duncanpharvey duncanpharvey marked this pull request as ready for review June 27, 2025 21:40
@duncanpharvey duncanpharvey requested review from a team as code owners June 27, 2025 21:41
@duncanpharvey duncanpharvey merged commit 3292584 into main Jul 1, 2025
864 of 866 checks passed
@duncanpharvey duncanpharvey deleted the duncan-harvey/azure-functions-servicebus-consumer-span-attributes branch July 1, 2025 17:46
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.

4 participants