Skip to content

[APM] Compute stats after span is fully finished#3443

Merged
darccio merged 3 commits into
mainfrom
ichinaski/css-after-finish
Apr 22, 2025
Merged

[APM] Compute stats after span is fully finished#3443
darccio merged 3 commits into
mainfrom
ichinaski/css-after-finish

Conversation

@ichinaski

@ichinaski ichinaski commented Apr 16, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

We must ensure all internal normalization happening in the Finish() call is performed before passing the Span to the SpanConcentrator. This ensures the StatSpan has a representation of the Span after being fully finalized.

This PR is a remediation for the following 2 issues from this list:

Motivation

See above link

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 golangci-lint run 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!

We must ensure all internal normalization happening in the Finish() call
is performed before passing the Span to the SpanConcentrator. This
ensures the StatSpan has a representation of the Span after being fully
finalized.
@ichinaski
ichinaski requested a review from a team as a code owner April 16, 2025 10:10
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Apr 16, 2025

Copy link
Copy Markdown

Datadog Report

Branch report: ichinaski/css-after-finish
Commit report: d1de7c3
Test service: dd-trace-go

✅ 0 Failed, 4485 Passed, 64 Skipped, 3m 51.62s Total Time

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

I need another set of eyes though

cc @darccio

@kakkoyun
kakkoyun requested a review from darccio April 16, 2025 10:20
@pr-commenter

pr-commenter Bot commented Apr 16, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-04-17 06:58:48

Comparing candidate commit a632963 in PR branch ichinaski/css-after-finish with baseline commit a284cf8 in branch main.

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

scenario:BenchmarkInjectW3C-24

  • 🟩 execution_time [-198.250ns; -160.550ns] or [-4.699%; -3.805%]

Comment thread ddtrace/tracer/span_test.go Outdated

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

The changes are safe.

@darccio
darccio enabled auto-merge (squash) April 22, 2025 15:40
@darccio
darccio merged commit a2a7560 into main Apr 22, 2025
@darccio
darccio deleted the ichinaski/css-after-finish branch April 22, 2025 15:53
@darccio darccio added the v2.0 label Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants