Skip to content

Conversation

brettlangdon
Copy link
Member

@brettlangdon brettlangdon commented Jul 3, 2025

Preparing the code for a future where we have multiple implementations of the AgentWriter.

I grabbed some minor adjacent type hinting stuff as well.

Split from #13071

We expect no major changes from this change. The only interesting change is the agent_url -> intake_url change which this is an internal/private class.

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

Preparing the code for a future where we have multiple implementations of the AgentWriter
@brettlangdon brettlangdon added the changelog/no-changelog A changelog entry is not required for this PR. label Jul 3, 2025
@brettlangdon brettlangdon requested review from a team as code owners July 3, 2025 18:27
Copy link
Contributor

github-actions bot commented Jul 3, 2025

CODEOWNERS have been resolved as:

ddtrace/_trace/processor/__init__.py                                    @DataDog/apm-sdk-api-python
ddtrace/_trace/tracer.py                                                @DataDog/apm-sdk-api-python
ddtrace/internal/ci_visibility/git_client.py                            @DataDog/ci-app-libraries
ddtrace/internal/ci_visibility/recorder.py                              @DataDog/ci-app-libraries
ddtrace/internal/debug.py                                               @DataDog/apm-core-python
ddtrace/internal/writer/__init__.py                                     @DataDog/apm-core-python
ddtrace/internal/writer/writer.py                                       @DataDog/apm-core-python
ddtrace/opentracer/tracer.py                                            @DataDog/apm-sdk-api-python
tests/appsec/integrations/utils_testagent.py                            @DataDog/asm-python
tests/commands/ddtrace_run_hostname.py                                  @DataDog/apm-core-python
tests/integration/test_debug.py                                         @DataDog/apm-core-python
tests/integration/test_integration.py                                   @DataDog/apm-core-python
tests/integration/test_integration_snapshots.py                         @DataDog/apm-core-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

Copy link
Contributor

github-actions bot commented Jul 3, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

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

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

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

Import time breakdown

The following import paths have grown:

ddtrace.auto 0.223 ms (0.08%)
ddtrace.bootstrap.sitecustomize 0.116 ms (0.04%)
ddtrace.bootstrap.preload 0.116 ms (0.04%)
ddtrace.internal.products 0.116 ms (0.04%)
importlib.metadata 0.116 ms (0.04%)
csv 0.116 ms (0.04%)
ddtrace 0.107 ms (0.04%)
ddtrace.trace 0.107 ms (0.04%)
ddtrace._trace.tracer 0.107 ms (0.04%)
ddtrace.internal.processor.endpoint_call_counter 0.107 ms (0.04%)

The following import paths have shrunk:

ddtrace.auto 2.340 ms (0.82%)
ddtrace.bootstrap.sitecustomize 1.537 ms (0.54%)
ddtrace.bootstrap.preload 1.537 ms (0.54%)
ddtrace.internal.remoteconfig.client 0.689 ms (0.24%)
ddtrace.internal.products 0.119 ms (0.04%)
importlib.metadata 0.119 ms (0.04%)
csv 0.119 ms (0.04%)
_csv 0.119 ms (0.04%)
ddtrace 0.803 ms (0.28%)
ddtrace.trace 0.122 ms (0.04%)
ddtrace._trace.tracer 0.122 ms (0.04%)
ddtrace.internal.schema.processor 0.122 ms (0.04%)
ddtrace.internal._unpatched 0.031 ms (0.01%)
json 0.031 ms (0.01%)
json.decoder 0.031 ms (0.01%)
re 0.031 ms (0.01%)
enum 0.031 ms (0.01%)
types 0.031 ms (0.01%)

@brettlangdon brettlangdon requested a review from a team as a code owner July 3, 2025 18:50
@brettlangdon brettlangdon requested a review from liashenko July 3, 2025 18:50
@brettlangdon brettlangdon marked this pull request as draft July 3, 2025 19:06
auto-merge was automatically disabled July 3, 2025 19:06

Pull request was converted to draft

@pr-commenter
Copy link

pr-commenter bot commented Jul 3, 2025

Benchmarks

Benchmark execution time: 2025-07-10 13:07:26

Comparing candidate commit a328c9b in PR branch LANGPLAT-134/agent-writer-interface with baseline commit b17d958 in branch main.

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

scenario:iastaspectsospath-ospathjoin_aspect

  • 🟥 execution_time [+0.980µs; +1.054µs] or [+15.911%; +17.109%]

Copy link
Contributor

@VianneyRuhlmann VianneyRuhlmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brettlangdon brettlangdon marked this pull request as ready for review July 7, 2025 13:35
@brettlangdon brettlangdon requested review from a team as code owners July 7, 2025 13:35
Co-authored-by: Emmett Butler <723615+emmettbutler@users.noreply.github.com>
@brettlangdon brettlangdon enabled auto-merge (squash) July 8, 2025 14:04
brettlangdon and others added 2 commits July 10, 2025 08:21
@brettlangdon brettlangdon merged commit dcf2746 into main Jul 10, 2025
863 checks passed
@brettlangdon brettlangdon deleted the LANGPLAT-134/agent-writer-interface branch July 10, 2025 13:54
alyshawang pushed a commit that referenced this pull request Jul 25, 2025
Preparing the code for a future where we have multiple implementations
of the AgentWriter.

I grabbed some minor adjacent type hinting stuff as well.

Split from #13071 

We expect no major changes from this change. The only interesting change
is the `agent_url` -> `intake_url` change which this is an
internal/private class.

## 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: Emmett Butler <723615+emmettbutler@users.noreply.github.com>
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.

6 participants