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

Report datadog.tracer.abandoned_spans health metric #3032

Merged
merged 7 commits into from
Dec 23, 2024

Conversation

mtoffl01
Copy link
Contributor

@mtoffl01 mtoffl01 commented Dec 12, 2024

What does this PR do?

Report the count of unfinished spans as a metric, along with tags about the span name and span integration.

This PR also makes the following small changes:

  • Amends abandonedSpansCandidate type to contain an Integration field
  • Modifies the TestStatsdClient for ease of use

Motivation

Abandoned spans info is already available in tracer logs, but making the information visible as a metric that we can track alongside other data points in the Datadog platform will make debugging easier for customer and support.

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!

@mtoffl01 mtoffl01 requested review from a team as code owners December 12, 2024 16:09
@mtoffl01 mtoffl01 marked this pull request as draft December 12, 2024 16:10
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Dec 12, 2024

Datadog Report

Branch report: mtoff/health-metrics-3
Commit report: e129ede
Test service: dd-trace-go

✅ 0 Failed, 5121 Passed, 70 Skipped, 2m 54.52s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Dec 12, 2024

Benchmarks

Benchmark execution time: 2024-12-23 16:30:12

Comparing candidate commit 286ed77 in PR branch mtoff/health-metrics-3 with baseline commit d393324 in branch main.

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

scenario:BenchmarkSetTagMetric-24

  • 🟩 execution_time [-7.943ns; -5.317ns] or [-6.119%; -4.096%]

scenario:BenchmarkSetTagString-24

  • 🟩 execution_time [-7.771ns; -4.049ns] or [-6.073%; -3.165%]

scenario:BenchmarkSetTagStringer-24

  • 🟩 execution_time [-8.327ns; -5.393ns] or [-5.282%; -3.421%]

scenario:BenchmarkTracerAddSpans-24

  • 🟥 execution_time [+100.110ns; +185.690ns] or [+2.498%; +4.634%]

@mtoffl01 mtoffl01 marked this pull request as ready for review December 18, 2024 18:20
Copy link
Member

@darccio darccio left a comment

Choose a reason for hiding this comment

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

LGTM, just left a non-blocking question

if v, ok := s.Meta[ext.Component]; ok {
integration = v
} else {
integration = "manual"
Copy link
Member

Choose a reason for hiding this comment

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

@mtoffl01 @hannahkm QQ: wouldn't a blank integration already indicate it's a span created manually? Is this required somewhere else to have manual as value?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the main concern is that leaving it blank might give the impression of being misconfigured/missing information. If we manually set it to manual here, it'll give a little more clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, exactly what Hannah said.
From being on the troubleshooting side, an explicit value (e.g. "manual") is a good way to differentiate from an unset/missing value.

Copy link
Member

Choose a reason for hiding this comment

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

LGTM then

@mtoffl01 mtoffl01 enabled auto-merge (squash) December 23, 2024 19:51
@mtoffl01 mtoffl01 merged commit 4f57a47 into main Dec 23, 2024
158 of 160 checks passed
@mtoffl01 mtoffl01 deleted the mtoff/health-metrics-3 branch December 23, 2024 19:58
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.

3 participants