Collect pack-object metrics through Git Trace2
From #2769 (comment 1143842619):
How about we do a first iteration and focus on the metrics surfaced through the trace2 mechanism for pack-objects, which include the following list:
- how many pack objects are being written
- loose objects written
- number of objects in a packfile
- time in prepare-pack
- time writing packfile
It would be neat to get a sense of these numbers by throwing them into Prometheus metrics (maybe histograms or summaries), so we can start getting a sense of what Git is doing on our most resource heavy operations which tend to be git-pack-objects.
This way, we can:
- get some useful metrics around pack-objects, which we need in the near term anyway
- prove out the usefulness of trace2
- built out a foundation to more easily add instrumentation of trace2 on other git operations in Gitaly in the future