I am trying to add custom labels for one of my webapi
snippet:
public ActionResult<IEnumerable<string>> GetTestList()
{
IEnumerable<string> result = new List<string>();
Pyroscope.LabelSet labels = Pyroscope.LabelSet.Empty.BuildUpon()
.Add("api_endpoint", "getunittestslist")
.Build();
Pyroscope.LabelsWrapper.Do(labels, () =>
{
result = TestService.GetTestsIds();
});
return StatusCode(200, result.ToList());
}
I have added 5 seconds of delay internally to test latency
The following are env variables:
#Profiling
DOTNET_EnableDiagnostics: 1
DOTNET_EnableDiagnostics_IPC: 0
DOTNET_EnableDiagnostics_Debugger: 0
DOTNET_EnableDiagnostics_Profiler: 1
PYROSCOPE_PROFILING_ENABLED: 1
PYROSCOPE_LABELS: pod_name:$(POD_NAME),node_name:$(NODE_NAME),pod_ip:$(POD_IP)
CORECLR_ENABLE_PROFILING: 1
CORECLR_PROFILER: ‘{BD1A650D-AC5D-4896-B64F-D6FA25D6B26A}’
CORECLR_PROFILER_PATH: /pyro/Pyroscope.Profiler.Native.so
LD_PRELOAD: /pyro/Pyroscope.Linux.ApiWrapper.x64.so
PYROSCOPE_PROFILING_CONTENTION_ENABLED: true
PYROSCOPE_PROFILING_CPU_ENABLED: true
PYROSCOPE_PROFILING_WALLTIME_ENABLED: true
PYROSCOPE_PROFILING_EXCEPTION_ENABLED: true
PYROSCOPE_PROFILING_ALLOCATION_ENABLED: true
PYROSCOPE_PROFILING_LOCK_ENABLED: true
PYROSCOPE_PROFILING_HEAP_ENABLED: true
LD_LIBRARY_PATH: /pyro
PYROSCOPE_SERVER_ADDRESS: “http://pyroscope-distributor.pyroscope.svc.cluster.local:4040”
PYROSCOPE_APPLICATION_NAME: “stest-api”