Account for Go gitlab-elasticsearch-indexer in elasticsearch_duration_s sidekiq log
Problem
There is no way for us to tell how much time the ElasticCommitIndexerWorker
spends waiting on Elasticsearch.
Further description and solution
In !32822 (merged) we introduced logging elasticsearch_duration_s
alongside any done sidekiq job. But this is done by hooking into the ruby client and tracking all the requests going through the ruby client.
This is not really useful in the ElasticCommitIndexerWorker
which mostly does Elasticsearch queries in the Go client that is shelled out. The only exception being if we need to purge commits/blobs due to a force push. This logging could be much more useful if we had the aggregated timings/counts also from the Go indexer in the logs.
One way to get the data out might be to return it from the CLI in STDOUT or a tmp file passed in as an arg if that is too difficult.
If all of that is too tricky the Go indexer should at least log this data as it goes so we can look at it later but this would not be as useful as seeing the timing information alongside the other timing data in the done
log in sidekiq.