You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add CPU profile collection to diagnostics handler (#4394)
Add the optional CPU profile collection to the diagnostic action handler.
CPU profiles will be collected if the REQUEST_DIAGNOSTICS action has the
optional additional_metrics parameter list contains "CPU".
Copy file name to clipboardexpand all lines: internal/pkg/diagnostics/diagnostics.go
+9
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,15 @@ const (
37
37
agentName="elastic-agent"
38
38
)
39
39
40
+
// DiagCPU* are contstants to describe the CPU profile that is collected when the --cpu-profile flag is used with the diagnostics command, or the diagnostics action contains "CPU" in the additional_metrics list.
41
+
const (
42
+
DiagCPUName="cpuprofile"
43
+
DiagCPUFilename="cpu.pprof"
44
+
DiagCPUDescription="CPU profile"
45
+
DiagCPUContentType="application/octet-stream"
46
+
DiagCPUDuration=30*time.Second
47
+
)
48
+
40
49
// Hook is a hook that gets used when diagnostic information is requested from the Elastic Agent.
0 commit comments