elastic / elastic/elastic-agent
elastic-agent diagnostics collect --pprof can fail if the collected profile exceeds the gRPC message size limit
- Dominant language
- Go
- Stars
- 275
- Forks
- 264
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 298
Description
This was originally encountered in by a support engineer helping a user:
```
./elastic-agent diagnostics collect --pprof
Failed to gather pprof data from elastic-agent: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (5855561 vs. 4194304)
Created diagnostics archive "elastic-agent-diagnostics-2022-07-13T07-08-08Z-00.zip"
***** WARNING *****
Created archive may contain plain text credentials.
Ensure that files in archive are redacted before sharing.
```
The default message size in gRPC in 4 MB which can be changed with https://pkg.go.dev/google.golang.org/grpc#MaxRecvMsgSize
A better solution is likely to chunk the profiles so they are guaranteed to stay under the configured message size limit.
Contributor guide
Assessment
This issue has not been assessed yet.