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

[PROF-3944] Change profiler to gather "local root span id" from active traces instead of "trace id" #1688

Merged
merged 4 commits into from
Oct 15, 2021

Conversation

ivoanjo
Copy link
Member

@ivoanjo ivoanjo commented Sep 16, 2021

The trace id that we gather today is not useful, because the backend ends up using the runtime-id and span id to get all information it needs.

Gathering instead the local root span id will enable the profiler backend to optimize scoping profiles in the UX down to a single request (all spans that share the same local root span id).

I've tested this both locally and on the reliability environment.

@ivoanjo ivoanjo requested a review from a team September 16, 2021 12:58
@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2021

Codecov Report

Merging #1688 (76414a5) into master (66dd1e9) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1688   +/-   ##
=======================================
  Coverage   98.17%   98.18%           
=======================================
  Files         934      934           
  Lines       45092    45122   +30     
=======================================
+ Hits        44271    44301   +30     
  Misses        821      821           
Impacted Files Coverage Δ
lib/ddtrace/profiling/trace_identifiers/helper.rb 100.00% <ø> (ø)
spec/ddtrace/profiling/spec_helper.rb 86.48% <ø> (ø)
lib/ddtrace/context.rb 97.05% <100.00%> (+0.06%) ⬆️
lib/ddtrace/ext/profiling.rb 100.00% <100.00%> (ø)
lib/ddtrace/profiling/collectors/stack.rb 100.00% <100.00%> (ø)
lib/ddtrace/profiling/events/stack.rb 100.00% <100.00%> (ø)
lib/ddtrace/profiling/pprof/stack_sample.rb 100.00% <100.00%> (ø)
lib/ddtrace/profiling/trace_identifiers/ddtrace.rb 100.00% <100.00%> (ø)
spec/ddtrace/context_spec.rb 99.68% <100.00%> (+0.01%) ⬆️
spec/ddtrace/profiling/collectors/stack_spec.rb 98.64% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66dd1e9...76414a5. Read the comment docs.

@marcotc marcotc added the profiling Involves Datadog profiling label Sep 16, 2021
Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

Please hold off on merging this one just yet; I don't necessarily object to the changes, but wanted to reconcile them with something else I had pending first.

@ivoanjo
Copy link
Member Author

ivoanjo commented Sep 27, 2021

@delner Since I think there's still some discussion and possibly changes needed in #1695, do you mind if I go ahead and merge this one?

@ivoanjo ivoanjo force-pushed the ivoanjo/profiler-track-local-root-span-id branch 2 times, most recently from cef2d74 to 5d18d2e Compare October 14, 2021 13:33
@ivoanjo
Copy link
Member Author

ivoanjo commented Oct 14, 2021

@marcotc / @delner care to re-review? I've fixed the merge conflict.

This method allows getting both the current span, as well as the root
span with atomic semantics, to avoid data races.
…e traces instead of "trace id"

The `trace id` that we gather today is not useful, because the
backend ends up using the `runtime-id` and `span id` to get all
information it needs.

Gathering instead the `local root span id` will enable the profiler
backend to optimize scoping profiles in the UX down to a single
request (all spans that share the same local root span id).
Otherwise the previous benchmark dump was innacurate, since the
resulting pprof no longer cared for the trace id that it included.

I've renamed the benchmark to "profiler_submission_v2" to mark the
change to the input data -- I've measured the performance of the
benchmark to stay similar, but not the same [within ~10%], so it's
relevant to mark this change.
@ivoanjo ivoanjo force-pushed the ivoanjo/profiler-track-local-root-span-id branch from 5d1035a to 76414a5 Compare October 15, 2021 17:34
@ivoanjo
Copy link
Member Author

ivoanjo commented Oct 15, 2021

Thanks Marco! I had to do one final rebase to fix a trivial conflict with #1718 , merging away now!

@ivoanjo ivoanjo merged commit 8f697cc into master Oct 15, 2021
@ivoanjo ivoanjo deleted the ivoanjo/profiler-track-local-root-span-id branch October 15, 2021 17:58
@github-actions github-actions bot added this to the 0.54.0 milestone Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
profiling Involves Datadog profiling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants