Skip to content

Conversation

@mtoffl01
Copy link
Contributor

@mtoffl01 mtoffl01 commented Dec 12, 2025

What does this PR do?

Migrates tracer to use Config.partialFlushMinSpans

Motivation

https://datadoghq.atlassian.net/browse/APMAPI-1745

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 ./scripts/lint.sh 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!

Copy link
Contributor Author

mtoffl01 commented Dec 12, 2025

@mtoffl01 mtoffl01 marked this pull request as ready for review December 12, 2025 17:20
@mtoffl01 mtoffl01 requested review from a team as code owners December 12, 2025 17:20
@pr-commenter
Copy link

pr-commenter bot commented Dec 12, 2025

Benchmarks

Benchmark execution time: 2025-12-19 17:24:25

Comparing candidate commit a325530 in PR branch 12-12-migrate_partialflushminspans with baseline commit 4c491d3 in branch 12-12-migrate_partialflushenabled.

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

Comment on lines 39 to 43
if minSpans < 0 {
log.Warn("ignoring DD_TRACE_PARTIAL_FLUSH_MIN_SPANS: negative value %d", minSpans)
return false
}
if minSpans > TraceMaxSize {
Copy link
Contributor

Choose a reason for hiding this comment

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

In the deleted code (ddtrace/tracer/option.go L427-430), minSpans values == 0 or TraceMaxSize were considered invalid. Should we keep that here?

@mtoffl01 mtoffl01 changed the base branch from 12-12-migrate_partialflushenabled to graphite-base/4260 December 17, 2025 15:23
@mtoffl01 mtoffl01 force-pushed the 12-12-migrate_partialflushminspans branch from ecac1f6 to 2aad4eb Compare December 17, 2025 15:26
@mtoffl01 mtoffl01 changed the base branch from graphite-base/4260 to 12-12-migrate_partialflushenabled December 17, 2025 15:26
@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 17.24138% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.59%. Comparing base (4c491d3) to head (a325530).

Files with missing lines Patch % Lines
internal/config/config.go 10.00% 9 Missing ⚠️
internal/config/config_helpers.go 0.00% 8 Missing ⚠️
internal/config/configprovider.go 12.50% 6 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
ddtrace/tracer/log.go 86.51% <100.00%> (ø)
ddtrace/tracer/option.go 84.25% <100.00%> (-0.18%) ⬇️
ddtrace/tracer/spancontext.go 90.18% <ø> (ø)
ddtrace/tracer/tracer.go 86.40% <100.00%> (ø)
internal/config/configprovider.go 78.26% <12.50%> (-6.27%) ⬇️
internal/config/config_helpers.go 0.00% <0.00%> (ø)
internal/config/config.go 27.93% <10.00%> (-1.48%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mtoffl01 mtoffl01 force-pushed the 12-12-migrate_partialflushminspans branch 2 times, most recently from 44a63e2 to 5a1651e Compare December 17, 2025 17:15
@mtoffl01 mtoffl01 force-pushed the 12-12-migrate_partialflushenabled branch from 502c122 to 221487e Compare December 17, 2025 17:15
@mtoffl01 mtoffl01 requested a review from hannahkm December 17, 2025 18:49
func (c *Config) SetPartialFlushMinSpans(minSpans int, origin telemetry.Origin) {
c.mu.Lock()
defer c.mu.Unlock()
c.partialFlushMinSpans = minSpans
Copy link
Member

Choose a reason for hiding this comment

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

Should we validate the values passed via programatic API ?

@mtoffl01 mtoffl01 changed the base branch from 12-12-migrate_partialflushenabled to graphite-base/4260 December 18, 2025 16:49
@mtoffl01 mtoffl01 force-pushed the 12-12-migrate_partialflushminspans branch from 5a1651e to 3f318b1 Compare December 18, 2025 16:52
@mtoffl01 mtoffl01 changed the base branch from graphite-base/4260 to 12-12-migrate_partialflushenabled December 18, 2025 16:52
@mtoffl01 mtoffl01 force-pushed the 12-12-migrate_partialflushenabled branch from 3752241 to da8511d Compare December 19, 2025 15:15
@mtoffl01 mtoffl01 force-pushed the 12-12-migrate_partialflushminspans branch from 3f318b1 to 9a9bb27 Compare December 19, 2025 15:15
@mtoffl01 mtoffl01 force-pushed the 12-12-migrate_partialflushminspans branch from 9a9bb27 to a325530 Compare December 19, 2025 16:48
@mtoffl01 mtoffl01 force-pushed the 12-12-migrate_partialflushenabled branch from da8511d to 4c491d3 Compare December 19, 2025 16:48
@mtoffl01 mtoffl01 closed this Jan 9, 2026
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.

4 participants