forked from DataDog/dd-trace-rb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for "user labels" on profiles in new profiler
This commit adds the concept of "user labels" on profiles. Currently, when we generate a sample for a profile, we add a label in the generated pprof for the thread name and the thread ID. The legacy old_stack.rb collector _also_ adds labels for the active trace span ID, trace ID, and trace resource name (via Datadog::Profiling::TraceIdentifiers), however the new profiler does not currently set these. The "user labels" concept extends this further by allowing applications to set arbitrary label key/value pairs on the current thread, which will then appear in any samples taken from that thread. This is done by calling Datadog::Profiling::Collectors::CpuAndWallTime#set_user_label - either with a key/value to set, or a nil value to unset. The intended use for this is to allow application developers who have obtained their pprof files (either by downloading from the Datadog UI, or by setting a custom `profiling.exporter.transport` implementation) to explore them using e.g. the https://github.com/google/pprof tool and facet them by arbitrary dimensions. For example, I have implemented this feature so we can see how the performance of certain methods varies depending on which customer is calliung them.
- Loading branch information
KJ Tsanaktsidis
committed
Oct 27, 2022
1 parent
ba2a1d6
commit 192e5c8
Showing
4 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters