Skip to content

feat(provider): expose context provider in ddtrace.trace [forwardport 3.x]#12155

Merged
erikayasuda merged 1 commit into3.x-stagingfrom
backport-12135-to-3.x
Jan 30, 2025
Merged

feat(provider): expose context provider in ddtrace.trace [forwardport 3.x]#12155
erikayasuda merged 1 commit into3.x-stagingfrom
backport-12135-to-3.x

Conversation

@erikayasuda
Copy link
Copy Markdown
Collaborator

@erikayasuda erikayasuda commented Jan 30, 2025

Forwardporting #12135

ddtrace v3.0 is set to remove ddtrace.providers module from the public API. However we should still allow users to use their own ContextProviders. This PR ensures the BaseContextProvider remains in the public API and can be used in tracer.configure(...).

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

(cherry picked from commit cb41f8e)

ddtrace v3.0 is set to remove `ddtrace.providers` module from the public
API. However we should still allow users to use their own
ContextProviders. This PR ensures the BaseContextProvider remains in the
public API and can be used in `tracer.configure(...)`.

## Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
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](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

(cherry picked from commit cb41f8e)
@erikayasuda erikayasuda requested review from a team as code owners January 30, 2025 08:50
@github-actions
Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

releasenotes/notes/feat-expose-base-context-provider-530ebec2225f6c8d.yaml  @DataDog/apm-python
.github/CODEOWNERS                                                      @DataDog/python-guild @DataDog/apm-core-python
ddtrace/provider.py                                                     @DataDog/apm-sdk-api-python
ddtrace/trace/__init__.py                                               @DataDog/apm-sdk-api-python
docs/advanced_usage.rst                                                 @DataDog/python-guild

@datadog-dd-trace-py-rkomorn
Copy link
Copy Markdown

Datadog Report

Branch report: backport-12135-to-3.x
Commit report: af7cdfc
Test service: dd-trace-py

✅ 0 Failed, 130 Passed, 1468 Skipped, 5m 23.58s Total duration (35m 41.42s time saved)

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Jan 30, 2025

Benchmarks

Benchmark execution time: 2025-01-30 09:36:12

Comparing candidate commit af7cdfc in PR branch backport-12135-to-3.x with baseline commit bf15c90 in branch 3.x-staging.

Found 0 performance improvements and 6 performance regressions! Performance is the same for 388 metrics, 2 unstable metrics.

scenario:iast_aspects-format_map_aspect

  • 🟥 execution_time [+446.339ns; +505.636ns] or [+8.471%; +9.596%]

scenario:iast_aspects-ospathbasename_aspect

  • 🟥 execution_time [+363.156ns; +423.786ns] or [+10.558%; +12.320%]

scenario:iast_aspects-ospathdirname_aspect

  • 🟥 execution_time [+339.514ns; +394.245ns] or [+9.265%; +10.758%]

scenario:iast_aspects-ospathnormcase_aspect

  • 🟥 execution_time [+193.749ns; +227.058ns] or [+7.711%; +9.036%]

scenario:iast_aspects-ospathsplit_aspect

  • 🟥 execution_time [+376.124ns; +442.505ns] or [+9.752%; +11.473%]

scenario:iast_aspects-ospathsplitext_aspect

  • 🟥 execution_time [+268.049ns; +323.331ns] or [+7.347%; +8.863%]

@erikayasuda erikayasuda merged commit f73a3fe into 3.x-staging Jan 30, 2025
@erikayasuda erikayasuda deleted the backport-12135-to-3.x branch January 30, 2025 12:01
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.

3 participants