WithGoroutineLabel
Gets a new context with Go Routine label key set and a label assigned to the context using pprof.Labels. You can then call pprof.SetGoroutineLabels(ctx) to annotate the current go-routine and have that show up in pprof analysis.
def WithGoroutineLabel(
ctx: context.Context,
routineLabel: string
) - > context.Context
Gets a new context with Go Routine label key set and a label assigned to the context using pprof.Labels. Call pprof.SetGoroutineLabels(ctx) to annotate the current go-routine for pprof analysis.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The parent context to which the goroutine label will be added. |
| routineLabel | string | The label string to associate with the goroutine for profiling purposes. |
Returns
| Type | Description |
|---|---|
context.Context | A new context with the goroutine label applied. |