Skip to content
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

chore(configs): internalize global config module and ddtrace.config's rc and http attributes [3.0] #12055

Merged
merged 7 commits into from
Jan 24, 2025

Conversation

mabdinur
Copy link
Contributor

@mabdinur mabdinur commented Jan 23, 2025

  • Prefixes the following ddtrace.config attributes with an _. These attributes are internal to the tracer and should not be referenced or modified by users. Users should enable remote configuration and set http configurations via environment variables:

    • http
    • http_server
    • trace_headers
    • header_is_traced
    • convert_rc_trace_sampling_rules
    • enable_remote_configuration
    • get_from
  • Deprecates ddtrace/settings/config.py and moves implementation details to ddtrace/settings/_config.py. Moving forward we will avoid exposing the implementation details for setting ddtrace configurations. All (or at least most) ddtrace configurations will be migrated to envier in v3.0.

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 Jan 23, 2025

CODEOWNERS have been resolved as:

ddtrace/settings/_config.py                                             @DataDog/apm-core-python
releasenotes/notes/munir-deprecate-rc-http-configs-206f6c60ff383c05.yaml  @DataDog/apm-python
ddtrace/__init__.py                                                     @DataDog/apm-core-python
ddtrace/_monkey.py                                                      @DataDog/apm-core-python
ddtrace/_trace/sampler.py                                               @DataDog/apm-sdk-api-python
ddtrace/contrib/flask/__init__.py                                       @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/httplib/__init__.py                                     @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/aiohttp/middlewares.py                         @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/botocore/patch.py                              @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/dramatiq/patch.py                              @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/httplib/patch.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/requests/connection.py                         @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/sanic/patch.py                                 @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/tornado/handlers.py                            @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/trace_utils.py                                 @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/jinja2/__init__.py                                      @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/requests/__init__.py                                    @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/internal/remoteconfig/worker.py                                 @DataDog/remote-config @DataDog/apm-core-python
ddtrace/internal/sampling.py                                            @DataDog/apm-sdk-api-python
ddtrace/internal/writer/writer.py                                       @DataDog/apm-core-python
ddtrace/propagation/_database_monitoring.py                             @DataDog/apm-sdk-api-python
ddtrace/settings/__init__.py                                            @DataDog/apm-core-python
ddtrace/settings/config.py                                              @DataDog/python-guild @DataDog/apm-sdk-api-python
ddtrace/settings/dynamic_instrumentation.py                             @DataDog/debugger-python
ddtrace/settings/integration.py                                         @DataDog/apm-core-python
docs/advanced_usage.rst                                                 @DataDog/python-guild
tests/ci_visibility/test_ci_visibility.py                               @DataDog/ci-app-libraries
tests/contrib/httplib/test_httplib_distributed.py                       @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/jinja2/test_jinja2.py                                     @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/requests/test_requests.py                                 @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/requests/test_requests_distributed.py                     @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/tornado/test_tornado_web.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/vertica/test_vertica.py                                   @DataDog/apm-core-python @DataDog/apm-idm-python
tests/internal/remoteconfig/test_remoteconfig.py                        @DataDog/remote-config @DataDog/apm-core-python
tests/internal/test_settings.py                                         @DataDog/apm-core-python
tests/telemetry/test_writer.py                                          @DataDog/apm-python
tests/tracer/test_env_vars.py                                           @DataDog/apm-sdk-api-python
tests/tracer/test_global_config.py                                      @DataDog/apm-sdk-api-python
tests/tracer/test_instance_config.py                                    @DataDog/apm-sdk-api-python
tests/tracer/test_settings.py                                           @DataDog/apm-sdk-api-python
tests/tracer/test_trace_utils.py                                        @DataDog/apm-sdk-api-python

@mabdinur mabdinur force-pushed the munir/deprecate-configs branch from 24f5c72 to 1bc3d74 Compare January 23, 2025 20:25
@mabdinur mabdinur changed the title chore(ddtrace.config): make rc and integration configs/methods internal chore(configs): make rc and http configs internal Jan 23, 2025
@mabdinur mabdinur force-pushed the munir/deprecate-configs branch 2 times, most recently from 37c1907 to e8d8a7f Compare January 23, 2025 21:53
@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Jan 23, 2025

Datadog Report

Branch report: munir/deprecate-configs
Commit report: 130b69b
Test service: dd-trace-py

✅ 0 Failed, 130 Passed, 1468 Skipped, 4m 42.63s Total duration (36m 29.15s time saved)

@mabdinur mabdinur force-pushed the munir/deprecate-configs branch from e8d8a7f to cd4acb3 Compare January 23, 2025 21:56
@DataDog DataDog deleted a comment from pr-commenter bot Jan 23, 2025
@mabdinur mabdinur marked this pull request as ready for review January 23, 2025 21:57
@mabdinur mabdinur requested review from a team as code owners January 23, 2025 21:57
@mabdinur mabdinur changed the title chore(configs): make rc and http configs internal chore(configs): make rc and http configs internal [3.0] Jan 23, 2025
@mabdinur mabdinur force-pushed the munir/deprecate-configs branch from cd4acb3 to 19d845c Compare January 23, 2025 22:03
@mabdinur mabdinur force-pushed the munir/deprecate-configs branch from 19d845c to fcc884b Compare January 23, 2025 22:08
@mabdinur mabdinur requested a review from a team as a code owner January 23, 2025 22:11
@mabdinur mabdinur force-pushed the munir/deprecate-configs branch from 55e0493 to d617660 Compare January 23, 2025 22:12
@pr-commenter
Copy link

pr-commenter bot commented Jan 23, 2025

Benchmarks

Benchmark execution time: 2025-01-24 18:22:30

Comparing candidate commit 130b69b in PR branch munir/deprecate-configs with baseline commit b90fa38 in branch main.

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

@mabdinur mabdinur enabled auto-merge (squash) January 23, 2025 23:20
@mabdinur mabdinur requested a review from erikayasuda January 23, 2025 23:20
ddtrace/settings/_config.py Show resolved Hide resolved
ddtrace/settings/_config.py Show resolved Hide resolved
ddtrace/settings/_config.py Show resolved Hide resolved
ddtrace/settings/_config.py Show resolved Hide resolved
ddtrace/settings/_config.py Show resolved Hide resolved
ddtrace/settings/_config.py Show resolved Hide resolved
@mabdinur mabdinur requested a review from a team as a code owner January 23, 2025 23:47
@mabdinur mabdinur force-pushed the munir/deprecate-configs branch from b1c43f5 to 3597a14 Compare January 23, 2025 23:59
@mabdinur mabdinur requested a review from a team as a code owner January 23, 2025 23:59
update rn

more nits
@mabdinur mabdinur force-pushed the munir/deprecate-configs branch from 3597a14 to 9cb55dc Compare January 24, 2025 00:00
@mabdinur mabdinur changed the title chore(configs): make rc and http configs internal [3.0] chore(configs): internalize config module and rc and http attributes [3.0] Jan 24, 2025
@mabdinur mabdinur changed the title chore(configs): internalize config module and rc and http attributes [3.0] chore(configs): internalize config module and ddtrace.config's rc and http attributes [3.0] Jan 24, 2025
@mabdinur mabdinur changed the title chore(configs): internalize config module and ddtrace.config's rc and http attributes [3.0] chore(configs): internalize global config module and ddtrace.config's rc and http attributes [3.0] Jan 24, 2025
Co-authored-by: Emmett Butler <[email protected]>
@mabdinur mabdinur merged commit 48c6547 into main Jan 24, 2025
748 checks passed
@mabdinur mabdinur deleted the munir/deprecate-configs branch January 24, 2025 21:03
Copy link
Contributor

The backport to 2.20 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.20 2.20
# Navigate to the new working tree
cd .worktrees/backport-2.20
# Create a new branch
git switch --create backport-12055-to-2.20
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 48c6547b8eb0cd10be7229ca78cc52704f62e14d
# Push it to GitHub
git push --set-upstream origin backport-12055-to-2.20
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.20

Then, create a pull request where the base branch is 2.20 and the compare/head branch is backport-12055-to-2.20.

mabdinur added a commit that referenced this pull request Jan 24, 2025
Prefixes the following `ddtrace.config` attributes with an `_`. These
attributes are internal to the tracer and should not be referenced or
modified by users:
- http
- http_server
- trace_headers
- header_is_traced
- convert_rc_trace_sampling_rules
- enable_remote_configuration
- get_from

Users should enable remote configuration and set `http` configurations
via environment variables.

- [ ] 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 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)
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.

5 participants