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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

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: 36181e8
Test service: dd-trace-go

✅ 0 Failed, 5120 Passed, 70 Skipped, 2m 36.98s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Dec 12, 2024

Benchmarks

Benchmark execution time: 2024-12-20 16:04:55

Comparing candidate commit 91f52b4 in PR branch mtoff/health-metrics-3 with baseline commit 637ea72 in branch main.

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

@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

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