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(tracing): removes constants from the public api [3.0] [backport 2.20] #12074

Open
wants to merge 1 commit into
base: 2.20
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

Backport b90fa38 from #12010 to 2.20.

Description

Prefixes constants that are internal to the ddtrace library with an underscore. These constants are not publicly documented and should not be referenced by users. Using the deprecated constants will log a deprecation warning in 2.X and an error in 3.X

Changes

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

## Description

Prefixes constants that are internal to the `ddtrace` library with an
underscore. These constants are not publicly documented and should not
be referenced by users. Using the deprecated constants will log a
deprecation warning in 2.X and an error in 3.X

## Changes

- Update constants in `ddtrace/contants.py`:
https://github.com/DataDog/dd-trace-py/pull/12010/files#diff-9fdb2ad4ee57c87a82b368d46e86cbc4726001da7e23cff7404f694813644cc6
- Ensure deprecated constants are not used in ddtrace internals

## 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 b90fa38)
@datadog-dd-trace-py-rkomorn
Copy link

Datadog Report

Branch report: backport-12010-to-2.20
Commit report: e4e2948
Test service: dd-trace-py

✅ 0 Failed, 1598 Passed, 0 Skipped, 27m 9.63s Total duration (14m 4.32s time saved)

@pr-commenter
Copy link

pr-commenter bot commented Jan 24, 2025

Benchmarks

Benchmark execution time: 2025-01-24 16:39:40

Comparing candidate commit e4e2948 in PR branch backport-12010-to-2.20 with baseline commit c70ba18 in branch 2.20.

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

@mabdinur mabdinur enabled auto-merge (squash) January 24, 2025 17:53
@mabdinur mabdinur closed this Jan 24, 2025
auto-merge was automatically disabled January 24, 2025 21:03

Pull request was closed

@mabdinur mabdinur reopened this Jan 24, 2025
Copy link
Contributor Author

CODEOWNERS have been resolved as:

releasenotes/notes/internalize-constants-3-0-73b6970b5a6f3aa5.yaml      @DataDog/apm-python
ddtrace/_trace/context.py                                               @DataDog/apm-sdk-api-python
ddtrace/_trace/processor/__init__.py                                    @DataDog/apm-sdk-api-python
ddtrace/_trace/sampler.py                                               @DataDog/apm-sdk-api-python
ddtrace/_trace/span.py                                                  @DataDog/apm-sdk-api-python
ddtrace/_trace/trace_handlers.py                                        @DataDog/apm-sdk-api-python
ddtrace/_trace/tracer.py                                                @DataDog/apm-sdk-api-python
ddtrace/_trace/utils_botocore/span_tags.py                              @DataDog/apm-sdk-api-python
ddtrace/_trace/utils_redis.py                                           @DataDog/apm-sdk-api-python
ddtrace/appsec/_iast/_iast_request_context.py                           @DataDog/asm-python
ddtrace/appsec/_processor.py                                            @DataDog/asm-python
ddtrace/constants.py                                                    @DataDog/apm-core-python
ddtrace/contrib/dbapi/__init__.py                                       @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/dbapi_async/__init__.py                                 @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/aiobotocore/patch.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/aiomysql/patch.py                              @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/aiopg/connection.py                            @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/aioredis/patch.py                              @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/algoliasearch/patch.py                         @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/asyncpg/patch.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/boto/patch.py                                  @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/bottle/trace.py                                @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/cassandra/session.py                           @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/celery/app.py                                  @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/celery/signals.py                              @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/consul/patch.py                                @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/django/utils.py                                @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/dogpile_cache/region.py                        @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/elasticsearch/patch.py                         @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/falcon/middleware.py                           @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/flask_cache/tracers.py                         @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/graphql/patch.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/grpc/aio_client_interceptor.py                 @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/grpc/aio_server_interceptor.py                 @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/grpc/client_interceptor.py                     @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/grpc/server_interceptor.py                     @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/httpx/patch.py                                 @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/jinja2/patch.py                                @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/kafka/patch.py                                 @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/kombu/patch.py                                 @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/mako/patch.py                                  @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/molten/patch.py                                @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/mysqldb/patch.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/psycopg/async_connection.py                    @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/psycopg/connection.py                          @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/psycopg/extensions.py                          @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/pylibmc/client.py                              @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/pymemcache/client.py                           @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/pymongo/client.py                              @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/pymongo/patch.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/pynamodb/patch.py                              @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/pyramid/trace.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/rediscluster/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/sqlalchemy/engine.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/vertica/patch.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/debugging/_signal/tracing.py                                    @DataDog/debugger-python
ddtrace/internal/_encoding.pyx                                          @DataDog/apm-core-python
ddtrace/internal/processor/stats.py                                     @DataDog/apm-core-python
ddtrace/internal/sampling.py                                            @DataDog/apm-sdk-api-python
ddtrace/internal/schema/processor.py                                    @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/internal/utils/http.py                                          @DataDog/apm-core-python
ddtrace/internal/writer/writer.py                                       @DataDog/apm-core-python
ddtrace/llmobs/_integrations/base.py                                    @DataDog/ml-observability
ddtrace/settings/endpoint_config.py                                     @DataDog/apm-core-python
tests/appsec/iast/test_processor.py                                     @DataDog/asm-python
tests/contrib/aiohttp/test_middleware.py                                @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/cherrypy/test_middleware.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/django/test_django.py                                     @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/gevent/test_tracer.py                                     @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/pyramid/test_pyramid.py                                   @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/pytest/test_pytest.py                                     @DataDog/ci-app-libraries
tests/contrib/tornado/test_tornado_web.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
tests/debugging/test_debugger.py                                        @DataDog/debugger-python
tests/integration/test_integration_snapshots.py                         @DataDog/apm-core-python
tests/integration/test_priority_sampling.py                             @DataDog/apm-sdk-api-python
tests/integration/test_trace_stats.py                                   @DataDog/apm-core-python
tests/internal/service_name/test_processor.py                           @DataDog/apm-core-python
tests/tracer/test_encoders.py                                           @DataDog/apm-sdk-api-python
tests/tracer/test_processors.py                                         @DataDog/apm-sdk-api-python
tests/tracer/test_sampler.py                                            @DataDog/apm-sdk-api-python
tests/tracer/test_single_span_sampling_rules.py                         @DataDog/apm-sdk-api-python
tests/tracer/test_span.py                                               @DataDog/apm-sdk-api-python
tests/tracer/test_tracer.py                                             @DataDog/apm-sdk-api-python
tests/tracer/test_writer.py                                             @DataDog/apm-sdk-api-python
tests/utils.py                                                          @DataDog/python-guild

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.

1 participant