[PROF-6691] Send span id in profiles as number and not string #2476
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?:
This PR changes the
span id
sent in profiling data (and used to power the "Code Hotspots" tab when viewing a trace) as a number in the underlying pprof, instead of as a string.Motivation:
The numeric representation is smaller and also avoids needing to use the string table to represent this information.
We've wanted to do this change for a while, but only now was the profiling backend extended to support this.
Additional Notes:
The
local root span id
is still recorded as a string because there's a feature in libdatadog that relies/assumes this string representation.I plan to later change libdatadog at a later time to allow us to send both values as a number.
This change affects only the new (still in alpha) Ruby profiler codepath, and thus is not expected to affect existing customers.
How to test the change?:
Change includes code coverage. Furthermore, you can validate this is working correctly by profiling an application that is generating traces, and checking that the "Code Hotspots" for spans show up correctly.