Skip to content

chore(tracer): add type annotation for HttpPropagator extract #13331

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rachelyangdog
Copy link
Contributor

@rachelyangdog rachelyangdog commented May 5, 2025

Add type annotation for HTTPPropagator extract method.

For Issue: #12737

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

@rachelyangdog rachelyangdog requested a review from a team as a code owner May 5, 2025 16:15
@rachelyangdog rachelyangdog requested a review from ZStriker19 May 5, 2025 16:15
Copy link
Contributor

github-actions bot commented May 5, 2025

CODEOWNERS have been resolved as:

ddtrace/propagation/http.py                                             @DataDog/apm-sdk-api-python

Copy link
Contributor

github-actions bot commented May 5, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

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

The average import time from base is: 238 ± 5 ms.

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

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 2.214 ms (0.95%)
ddtrace.bootstrap.sitecustomize 1.536 ms (0.66%)
ddtrace.bootstrap.preload 1.536 ms (0.66%)
ddtrace.internal.products 1.536 ms (0.66%)
ddtrace.internal.remoteconfig.client 0.697 ms (0.30%)
ddtrace 0.678 ms (0.29%)

@pr-commenter
Copy link

pr-commenter bot commented May 5, 2025

Benchmarks

Benchmark execution time: 2025-05-05 18:22:08

Comparing candidate commit 0901e54 in PR branch rachel.yang/extract-http with baseline commit 601c0bd in branch main.

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

scenario:iast_aspects-format_map_aspect

  • 🟥 execution_time [+432.857ns; +505.721ns] or [+13.144%; +15.356%]

scenario:iast_aspects-ospathdirname_aspect

  • 🟥 execution_time [+759.598ns; +917.429ns] or [+16.736%; +20.213%]

scenario:telemetryaddmetric-1-distribution-metric-1-times

  • 🟥 execution_time [+237.149ns; +297.312ns] or [+7.830%; +9.817%]

@mabdinur
Copy link
Contributor

mabdinur commented May 5, 2025

typing is failing: https://gitlab.ddbuild.io/DataDog/apm-reliability/dd-trace-py/-/jobs/924198441. This points to a bug in the injection/extraction logic. We should make sure these methods never return None.

@rachelyangdog rachelyangdog added the changelog/no-changelog A changelog entry is not required for this PR. label May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants