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

[Draft; don't merge] v1 as frontend of v2 #2607

Draft
wants to merge 147 commits into
base: main
Choose a base branch
from
Draft

[Draft; don't merge] v1 as frontend of v2 #2607

wants to merge 147 commits into from

Conversation

darccio
Copy link
Contributor

@darccio darccio commented Mar 11, 2024

What does this PR do?

Turns the current v1 a frontend of v2, wrapping the new API while keeping the original behaviour.

Motivation

Simplify internal testing and future migration to v2.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

For Datadog employees:

  • If this PR touches code that handles credentials of any kind, such as Datadog API keys, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

…ounterparts

Some functions have been adapted if v2 changed the API. Type aliases are the preferred way to convert types unless introducing an alias may leak v2 details.

We kept some types as they would expose v2 types, using manual conversion for these in the frontend functions that require them.

We kept as much tests as possible, but some were removed because they were asserting internal working no longer accessible, as v1 is an external user of v2.
…ir v2 counterparts

The original API is kept as is, wrapping around v2 equivalent code and configs, maintaining the behaviour expected by the package's tests.
…terparts

The conversion turned the API to a pure transparent frontend, with exported functions calling their v2 versions.
…parts

The conversion turned the API to a pure transparent frontend, with exported functions calling their v2 versions, including the types as v2 aliases.
The conversion turned the API to a pure transparent frontend, with exported functions calling their v2 versions.
…2 counterparts

The conversion turned the API to a pure transparent frontend, with exported functions calling their v2 versions.

Option types have been aliased, and contrib types have been used as wrappers to embed their v2 versions.
…ion for tests expecting v1's mocktracer.Span
contrib/jackc/pgx.v5/option.go Outdated Show resolved Hide resolved
contrib/jackc/pgx.v5/option.go Outdated Show resolved Hide resolved
@DataDog DataDog deleted a comment from pr-commenter bot Mar 19, 2024
@pr-commenter
Copy link

pr-commenter bot commented Mar 19, 2024

Benchmarks

Benchmark execution time: 2024-03-20 12:43:36

Comparing candidate commit 390dd0b in PR branch vits with baseline commit 485e60e in branch main.

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

scenario:BenchmarkHttpServeTrace-24

  • 🟥 allocations [+3; +3] or [+3.797%; +3.797%]
  • 🟥 execution_time [+1.510µs; +1.730µs] or [+9.152%; +10.485%]

scenario:BenchmarkOTelApiWithCustomTags/datadog_otel_api-24

  • 🟥 allocations [+3; +3] or [+10.000%; +10.000%]
  • 🟥 execution_time [+740.456ns; +842.344ns] or [+15.730%; +17.895%]

scenario:BenchmarkOTelApiWithCustomTags/otel_api-24

  • 🟩 allocated_mem [-202 bytes; -188 bytes] or [-4.059%; -3.776%]

scenario:BenchmarkPartialFlushing/Disabled-24

  • 🟩 allocated_mem [-302.496MB; -302.413MB] or [-96.688%; -96.662%]
  • 🟩 allocations [-2674157; -2672761] or [-84.265%; -84.221%]
  • 🟩 avgHeapInUse(Mb) [-45.281MB; -39.629MB] or [-69.704%; -61.003%]
  • 🟩 execution_time [-252.199ms; -250.646ms] or [-91.502%; -90.939%]

scenario:BenchmarkPartialFlushing/Enabled-24

  • 🟩 allocated_mem [-400.177MB; -397.725MB] or [-97.758%; -97.159%]
  • 🟩 allocations [-2683410; -2683401] or [-84.292%; -84.292%]
  • 🟩 avgHeapInUse(Mb) [-43.806MB; -41.704MB] or [-70.147%; -66.781%]
  • 🟩 execution_time [-249.037ms; -246.381ms] or [-91.599%; -90.622%]

scenario:BenchmarkSingleSpanRetention/no-rules-24

  • 🟩 allocated_mem [-151.416KB; -151.415KB] or [-93.531%; -93.531%]
  • 🟩 allocations [-922; -922] or [-64.702%; -64.702%]
  • 🟩 execution_time [-213.623µs; -212.891µs] or [-90.413%; -90.103%]

scenario:BenchmarkSingleSpanRetention/with-rules/match-all-24

  • 🟩 allocated_mem [-153.781KB; -153.705KB] or [-93.646%; -93.600%]
  • 🟩 allocations [-922; -922] or [-64.702%; -64.702%]
  • 🟩 execution_time [-214.102µs; -213.806µs] or [-90.118%; -89.993%]

scenario:BenchmarkSingleSpanRetention/with-rules/match-half-24

  • 🟩 allocated_mem [-153.765KB; -153.703KB] or [-93.642%; -93.604%]
  • 🟩 allocations [-922; -922] or [-64.702%; -64.702%]
  • 🟩 execution_time [-214.193µs; -213.736µs] or [-90.143%; -89.951%]

scenario:BenchmarkStartRequestSpan-24

  • 🟥 allocated_mem [+8 bytes; +8 bytes] or [+4.545%; +4.545%]
  • 🟥 allocations [+1; +1] or [+20.000%; +20.000%]
  • 🟥 execution_time [+39.791ns; +41.009ns] or [+10.842%; +11.174%]

scenario:BenchmarkStartSpan-24

  • 🟩 allocated_mem [-1.524KB; -1.524KB] or [-94.541%; -94.541%]
  • 🟩 allocations [-11; -11] or [-68.750%; -68.750%]
  • 🟩 execution_time [-2.035µs; -2.025µs] or [-89.138%; -88.724%]

scenario:BenchmarkTracerAddSpans-24

  • 🟩 allocated_mem [-2.040KB; -2.040KB] or [-90.426%; -90.426%]
  • 🟩 allocations [-17; -17] or [-68.000%; -68.000%]
  • 🟩 execution_time [-3.550µs; -3.521µs] or [-90.363%; -89.621%]

Copy link

This PR is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale Stuck for more than 1 month label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs stale Stuck for more than 1 month
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant