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

contrib/internal/httptrace: add telemetry for inferred spans #3119

Merged
merged 4 commits into from
Jan 28, 2025

Conversation

zarirhamza
Copy link
Contributor

What does this PR do?

Adds telemetry for inferred span tracking only if the env var DD_TRACE_INFERRED_PROXY_SERVICES_ENABLED is set to true

Motivation

Track usage of new inferred proxy spans

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!

@zarirhamza zarirhamza requested review from a team as code owners January 24, 2025 16:39
@github-actions github-actions bot added the apm:ecosystem contrib/* related feature requests or bugs label Jan 24, 2025
@datadog-datadog-prod-us1
Copy link

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

Datadog Report

Branch report: zarir/add-telemetry-inferred-spans
Commit report: 67114d2
Test service: dd-trace-go

✅ 0 Failed, 5207 Passed, 72 Skipped, 2m 20.08s Total Time

Comment on lines 71 to 72
telemetry.GlobalClient.ConfigChange([]telemetry.Configuration{{Name: "inferred_proxy_services_enabled",
Value: cfg.inferredProxyServicesEnabled}})
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you want to send this telemetry every time there is an http request. I think this makes more sense to be tracked when the configuration is initialized, which would be in the newConfig function from this package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by wrapping it with sync.Once. Cannot move to config file because all those variables are called pre tracer and telemetry client initialization

@pr-commenter
Copy link

pr-commenter bot commented Jan 24, 2025

Benchmarks

Benchmark execution time: 2025-01-27 18:01:15

Comparing candidate commit ae023f4 in PR branch zarir/add-telemetry-inferred-spans with baseline commit ef2e4e2 in branch main.

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

@zarirhamza zarirhamza enabled auto-merge (squash) January 27, 2025 17:25
@rarguelloF rarguelloF self-requested a review January 27, 2025 17:38
@rarguelloF rarguelloF disabled auto-merge January 27, 2025 17:38
Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

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

LGTM.

@rarguelloF rarguelloF enabled auto-merge (squash) January 28, 2025 13:10
@rarguelloF rarguelloF merged commit dde97eb into main Jan 28, 2025
175 of 176 checks passed
@rarguelloF rarguelloF deleted the zarir/add-telemetry-inferred-spans branch January 28, 2025 13:23
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants