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

all: replace internal/telemetry by internal/newtelemetry #3136

Open
wants to merge 8 commits into
base: eliott.bouhana/newtelemetry
Choose a base branch
from

Conversation

eliottness
Copy link
Contributor

@eliottness eliottness commented Jan 31, 2025

What does this PR do?

This PR replace the old telemetry client with the new one. It does, in order:

  • git rm -r internal/telemetry
  • git mv internal/newtelemetry internal/telemetry
  • Apply changes on the parts of the API that changed signicantly:
    • The way to start a new telemetry client is different, no more telemetry.ApplyOps
    • The API for metrics has been changed for better performances
  • Rework the internal/telemetry/telemetrytest package because it was not using github.com/stretchr/testify/mock correctly (like, not at all)
  • Update a literral TON of tests that were using the horrible telemetrytest API

Motivation

Better telemetry and support for telemetry metrics in the customer request hot path.
RFC: 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.
  • For internal contributors, a matching PR should be created to the v2-dev branch and reviewed by @DataDog/apm-go.

Unsure? Have a question? Request a review!

@datadog-datadog-prod-us1
Copy link

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

Datadog Report

Branch report: eliott.bouhana/remove-oldtelemetry
Commit report: 666eb03
Test service: dd-trace-go

✅ 0 Failed, 5301 Passed, 72 Skipped, 3m 11.4s Total Time
⌛ 1 Performance Regression

⌛ Performance Regressions vs Default Branch (1)

  • TestTracerCleanStop - gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer 1m 55.62s (+1m 42.77s, +800%) - Details

@eliottness eliottness force-pushed the eliott.bouhana/remove-oldtelemetry branch from bae4771 to 00e7b91 Compare January 31, 2025 14:58
@pr-commenter
Copy link

pr-commenter bot commented Jan 31, 2025

Benchmarks

Benchmark execution time: 2025-02-10 18:57:32

Comparing candidate commit 96bf15a in PR branch eliott.bouhana/remove-oldtelemetry with baseline commit 04e09de in branch eliott.bouhana/newtelemetry.

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

scenario:BenchmarkOTelApiWithCustomTags/otel_api-24

  • 🟥 allocated_mem [+124 bytes; +133 bytes] or [+2.570%; +2.759%]
  • 🟥 allocations [+2; +2] or [+4.651%; +4.651%]

scenario:BenchmarkSetTagString-24

  • 🟩 execution_time [-6.291ns; -3.129ns] or [-5.411%; -2.691%]

scenario:BenchmarkStartRequestSpan-24

  • 🟥 execution_time [+10.763ns; +12.017ns] or [+2.960%; +3.305%]

@eliottness eliottness force-pushed the eliott.bouhana/remove-oldtelemetry branch from 00e7b91 to 3069417 Compare January 31, 2025 15:33
@eliottness eliottness force-pushed the eliott.bouhana/newtelemetry branch from 51286ca to 8bc28bc Compare January 31, 2025 15:56
@eliottness eliottness force-pushed the eliott.bouhana/remove-oldtelemetry branch 6 times, most recently from 91f3955 to b9952a7 Compare February 7, 2025 10:50
@eliottness eliottness force-pushed the eliott.bouhana/remove-oldtelemetry branch from d5012b4 to c5dc1db Compare February 7, 2025 16:27
@eliottness eliottness force-pushed the eliott.bouhana/newtelemetry branch from 96edeb3 to 3dd727b Compare February 7, 2025 16:33
@eliottness eliottness force-pushed the eliott.bouhana/remove-oldtelemetry branch 5 times, most recently from f0a115b to 51d4ce0 Compare February 10, 2025 14:37
@eliottness eliottness marked this pull request as ready for review February 10, 2025 14:39
@eliottness eliottness requested review from a team as code owners February 10, 2025 14:39
@eliottness eliottness requested review from a team as code owners February 10, 2025 14:39
@eliottness eliottness force-pushed the eliott.bouhana/remove-oldtelemetry branch 2 times, most recently from 4a90d86 to 779bc66 Compare February 10, 2025 15:48
… would not reduce the value of the flushing interval

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]>
@eliottness eliottness force-pushed the eliott.bouhana/remove-oldtelemetry branch from 779bc66 to 96bf15a Compare February 10, 2025 17:39
Copy link
Contributor

@nsrip-dd nsrip-dd left a comment

Choose a reason for hiding this comment

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

I'll confess I didn't read most of this too closely, but the profiling bits look reasonable. Thanks for tackling this!

})
log.Debug("internal/httptrace: telemetry.ConfigChange called with cfg: %v:", cfg)
telemetry.RegisterAppConfig("inferred_proxy_services_enabled", cfg.inferredProxyServicesEnabled, telemetry.OriginEnvVar)
log.Debug("internal/httptrace: telemetry.RegisterAppConfig called with cfg: %v", cfg)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this log? Debug mode is typically used by customers when troubleshooting some issue, but customers don't even have access to telemetry, so not sure we need it?

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.

3 participants