Upload profile data to Stackdriver service
A detailed issue on the subject exists at gitlab-com/gl-infra/scalability#101. Though we'll track the progress for Labkit here.
The goal is extending the monitoring module to support cloud.google.com/go/profiler bindings with the following plan:
- Add a call to
profiler.Startfrom the monitoring initializer. Nodes can then be initialized using an environment variable such asGITLAB_CONTINUOUS_PROFILING=stackdriver?project_id=bamboo-project-606which would enable the profiling optionally - Roll the change out to Labkit users (Gitaly, Workhorse, Praefect, etc)
- We can then start testing in staging by adding the
GITLAB_CONTINUOUS_PROFILINGenvironment variable on some nodes.
Interesting information can be found at https://medium.com/google-cloud/continuous-profiling-of-go-programs-96d4416af77b.
Calling Start will start a goroutine to collect profiles and upload to the profiler server, at the rhythm specified by the server.
Edited by Oswaldo Ferreira