Skip to content

orchestrion: don't trace the tracer even if tracer.Start(tracer.WithHTTPClient(...)) is called#3559

Merged
eliottness merged 6 commits into
mainfrom
eliottness/telemetry-traced
Jun 3, 2025
Merged

orchestrion: don't trace the tracer even if tracer.Start(tracer.WithHTTPClient(...)) is called#3559
eliottness merged 6 commits into
mainfrom
eliottness/telemetry-traced

Conversation

@eliottness

@eliottness eliottness commented May 28, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR was originally made to fix an issue where traces where generated on orchestrion apps from the calls made inside dd-trace-go's telemetry client. Which later revealed that any part of the tracer was susceptible to auto-tracing if a call to tracer.Start is made using the option WithHTTPClient

This PR also add tests at the orchestrion testing framework harness level to make sure this does not happen anymore.

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.
  • New code is free of linting errors. You can check this by running golangci-lint run locally.
  • 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!

@github-actions github-actions Bot added the apm:ecosystem contrib/* related feature requests or bugs label May 28, 2025
@eliottness eliottness added the bug unintended behavior that has to be fixed label May 28, 2025
@pr-commenter

pr-commenter Bot commented May 28, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-06-03 09:49:59

Comparing candidate commit a226a9b in PR branch eliottness/telemetry-traced with baseline commit 3f36431 in branch main.

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

@eliottness
eliottness force-pushed the eliottness/telemetry-traced branch 5 times, most recently from 72c0b8c to dc6223d Compare May 30, 2025 12:36
@eliottness
eliottness force-pushed the eliottness/telemetry-traced branch from dc6223d to e8d8e42 Compare May 30, 2025 12:56
@eliottness eliottness changed the title contrib/net/http: don't trace new telemetry client orchestrion: don't trace the tracer May 30, 2025
@eliottness eliottness changed the title orchestrion: don't trace the tracer orchestrion: don't trace the tracer even if tracer.Start(tracer.WithHTTPClient(...)) is called May 30, 2025
copyClient := *config.HTTPClient
config.HTTPClient = &copyClient
config.HTTPClient.Timeout = 5 * time.Second
log.Debug("telemetry/writer: client timeout was higher than 5 seconds, clamping it to 5 seconds")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I realized this is happening everywhere so I removed the debug log

Comment on lines -33 to -34
//
//orchestrion:ignore

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is so that orchestrion can actually add the DD_tracer_internal: true field here

@eliottness
eliottness marked this pull request as ready for review May 30, 2025 13:26
@eliottness
eliottness requested review from a team as code owners May 30, 2025 13:26
@eliottness
eliottness requested a review from Mariovido May 30, 2025 13:26
Comment thread ddtrace/tracer/option.go Outdated

@tonyredondo tonyredondo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this

@eliottness
eliottness requested a review from darccio June 2, 2025 11:21
@eliottness
eliottness enabled auto-merge (squash) June 2, 2025 11:41
@eliottness
eliottness removed the request for review from Mariovido June 3, 2025 09:39
@eliottness
eliottness merged commit df5976c into main Jun 3, 2025
@eliottness
eliottness deleted the eliottness/telemetry-traced branch June 3, 2025 09:56
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 bug unintended behavior that has to be fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants