Skip to content

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

Merged
rarguelloF merged 4 commits into
mainfrom
zarir/add-telemetry-inferred-spans
Jan 28, 2025
Merged

contrib/internal/httptrace: add telemetry for inferred spans#3119
rarguelloF merged 4 commits into
mainfrom
zarir/add-telemetry-inferred-spans

Conversation

@zarirhamza

Copy link
Copy Markdown
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

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

Copy link
Copy Markdown

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 thread contrib/internal/httptrace/httptrace.go Outdated
Comment on lines +71 to +72
telemetry.GlobalClient.ConfigChange([]telemetry.Configuration{{Name: "inferred_proxy_services_enabled",
Value: cfg.inferredProxyServicesEnabled}})

Copy link
Copy Markdown
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
Copy Markdown
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

pr-commenter Bot commented Jan 24, 2025

Copy link
Copy Markdown

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

@kakkoyun kakkoyun 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.

LGTM.

@rarguelloF
rarguelloF enabled auto-merge (squash) January 28, 2025 13:10
@rarguelloF
rarguelloF merged commit dde97eb into main Jan 28, 2025
@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