Closed
Description
I propose adding a mechanism to the runtime and profiling code to allow for annotating profile samples with key-value labels. These labels are an already-existing feature of pprof that we do not support yet.
The user interface would look something like this:
package context
type ProfileLabel struct {
Key string
Value string
}
// DoWithLabels calls f with a copy of the parent context with the
// given labels appended. The set of labels on that context will be set
// for the duration of the call to f and restored once f returns.
func DoWithLabels(parent Context, labels []ProfileLabel, f func(ctx Context))
More details in the proposal document