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] #12010

Merged
merged 9 commits into from
Jan 24, 2025

Conversation

mabdinur
Copy link
Contributor

@mabdinur mabdinur commented Jan 21, 2025

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

Copy link
Contributor

github-actions bot commented Jan 21, 2025

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

@mabdinur mabdinur changed the title chore(constants): removes constants from the public api chore(tracing): removes constants from the public api Jan 21, 2025
@mabdinur mabdinur marked this pull request as ready for review January 21, 2025 19:57
@mabdinur mabdinur requested review from a team as code owners January 21, 2025 19:57
@pr-commenter
Copy link

pr-commenter bot commented Jan 21, 2025

Benchmarks

Benchmark execution time: 2025-01-23 16:58:16

Comparing candidate commit c698057 in PR branch munir/internalize-constants with baseline commit ff41c13 in branch main.

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

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

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

Datadog Report

Branch report: munir/internalize-constants
Commit report: 83d454e
Test service: dd-trace-py

✅ 0 Failed, 1048 Passed, 550 Skipped, 17m 1.22s Total duration (22m 56.17s time saved)

@mabdinur mabdinur force-pushed the munir/internalize-constants branch from 2bc3392 to ed9d8fd Compare January 22, 2025 19:07
@mabdinur mabdinur force-pushed the munir/internalize-constants branch from ed9d8fd to 83d454e Compare January 22, 2025 19:53
@datadog-dd-trace-py-rkomorn
Copy link

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

Datadog Report

Branch report: munir/internalize-constants
Commit report: c698057
Test service: dd-trace-py

✅ 0 Failed, 130 Passed, 1468 Skipped, 4m 37.62s Total duration (35m 37.5s time saved)

@mabdinur mabdinur requested a review from a team as a code owner January 23, 2025 14:57
@mabdinur mabdinur force-pushed the munir/internalize-constants branch from 601045e to fa8ed62 Compare January 23, 2025 14:58
@mabdinur mabdinur changed the title chore(tracing): removes constants from the public api chore(tracing): removes constants from the public api [3.0] Jan 23, 2025
@mabdinur mabdinur force-pushed the munir/internalize-constants branch from fa8ed62 to c698057 Compare January 23, 2025 16:17
@mabdinur mabdinur requested a review from P403n1x87 January 23, 2025 18:03
@mabdinur mabdinur enabled auto-merge (squash) January 24, 2025 15:40
@mabdinur mabdinur merged commit b90fa38 into main Jan 24, 2025
637 checks passed
@mabdinur mabdinur deleted the munir/internalize-constants branch January 24, 2025 15:58
github-actions bot pushed a commit that referenced this pull request Jan 24, 2025
## 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)
erikayasuda pushed a commit that referenced this pull request Jan 30, 2025
… 2.20] (#12074)

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

- 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)

Co-authored-by: Munir Abdinur <munir.abdinur@datadoghq.com>
ZStriker19 pushed a commit that referenced this pull request Jan 30, 2025
## 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)
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.

7 participants