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

internal/telemetry: revamp #2996

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

Conversation

eliottness
Copy link
Contributor

What does this PR do?

This PR rebuilds fron scratch the current instrumentation telemetry client. More informations here:
https://docs.google.com/document/d/1C3xoTZHQZNQ-Jr1w5mMThIkpHNW_4qKRf-J5CNi7G-k/edit?pli=1&tab=t.0#heading=h.88xvn2cvs9dt

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.

Unsure? Have a question? Request a review!

@pr-commenter
Copy link

pr-commenter bot commented Nov 27, 2024

Benchmarks

Benchmark execution time: 2025-01-22 18:00:50

Comparing candidate commit bce2138 in PR branch eliott.bouhana/newtelemetry with baseline commit 241a6f1 in branch main.

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

@eliottness eliottness force-pushed the eliott.bouhana/newtelemetry branch from bb195d0 to 58aaf77 Compare January 13, 2025 14:34
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jan 13, 2025

Datadog Report

Branch report: eliott.bouhana/newtelemetry
Commit report: 29cdaf2
Test service: dd-trace-go

❌ 4 Failed (0 Known Flaky), 5225 Passed, 72 Skipped, 2m 27.22s Total Time

❌ Failed Tests (4)

  • TestClientEnd2End - gopkg.in/DataDog/dd-trace-go.v1/internal/newtelemetry - Details

    Expand for error
     Failed
     
     === RUN   TestClientEnd2End
     --- FAIL: TestClientEnd2End (0.00s)
         assertions.go:363:
    
  • TestClientEnd2End/app-start - gopkg.in/DataDog/dd-trace-go.v1/internal/newtelemetry - Details

    Expand for error
     Failed
     
     === RUN   TestClientEnd2End/app-start
     === PAUSE TestClientEnd2End/app-start
     === CONT  TestClientEnd2End/app-start
         client_test.go:465: 
             	Error Trace:	/home/runner/work/dd-trace-go/dd-trace-go/internal/newtelemetry/client_test.go:465
             	            				/home/runner/work/dd-trace-go/dd-trace-go/internal/newtelemetry/client_test.go:514
             	            				/home/runner/work/dd-trace-go/dd-trace-go/internal/newtelemetry/client_test.go:398
             	            				/opt/hostedtoolcache/go/1.22.11/x64/src/net/http/client.go:259
     ...
    
  • TestClientEnd2End/app-start+app-stop - gopkg.in/DataDog/dd-trace-go.v1/internal/newtelemetry - Details

    Expand for error
     Failed
     
     === RUN   TestClientEnd2End/app-start+app-stop
     === PAUSE TestClientEnd2End/app-start+app-stop
     === CONT  TestClientEnd2End/app-start+app-stop
         testing.go:1398: race detected during execution of test
    
  • TestClientEnd2End/app-stop - gopkg.in/DataDog/dd-trace-go.v1/internal/newtelemetry - Details

    Expand for error
     Failed
     
     === RUN   TestClientEnd2End/app-stop
     === PAUSE TestClientEnd2End/app-stop
     === CONT  TestClientEnd2End/app-stop
     ==================
     Write at 0x00c00039a480 by goroutine 47:
       gopkg.in/DataDog/dd-trace-go.v1/internal/newtelemetry.TestClientEnd2End.func8()
           /home/runner/work/dd-trace-go/dd-trace-go/internal/newtelemetry/client_test.go:511 +0x204
       testing.tRunner()
     ...
    

@eliottness eliottness force-pushed the eliott.bouhana/newtelemetry branch 3 times, most recently from 3624406 to 54a315e Compare January 15, 2025 16:16
Signed-off-by: Eliott Bouhana <[email protected]>

wip

Signed-off-by: Eliott Bouhana <[email protected]>
Signed-off-by: Eliott Bouhana <[email protected]>
centralize all http concerns in the writer struct such as:
* Reusing the same top-level structures when possible
* encoding properly in json the payload
* separating the low level http writing from some higher level things we will concerns ourselves about in the telemetry client itself
* Centralizing a lot of the static data the telemtry client is supposed to send on every request

Signed-off-by: Eliott Bouhana <[email protected]>
Signed-off-by: Eliott Bouhana <[email protected]>
Signed-off-by: Eliott Bouhana <[email protected]>
Signed-off-by: Eliott Bouhana <[email protected]>
Signed-off-by: Eliott Bouhana <[email protected]>
… the Size() method on data sources. Put back support for the payloadQueue in case Flush calls are failing

Signed-off-by: Eliott Bouhana <[email protected]>
Signed-off-by: Eliott Bouhana <[email protected]>
@eliottness eliottness force-pushed the eliott.bouhana/newtelemetry branch from 71bf34b to 6dad2a3 Compare January 22, 2025 15:40
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