Collect Events From Docker Registry And Display Metrics On Container Registry Page
Description
The Docker registry can be configured to notify Gitlab CE of events whenever there are pulls and pushes to a repository. We should start by adding an API to Gitlab to receive these events. We can then display metrics about the container registry on the container registry page. While I can see that collecting metrics alone is not enough to generate user value it is a fairly small chunk of work and the next step to figure out how to present that information to users will probably require some research and validation.
Some options for displaying to a user will be:
- Total number of pulls for a repository
- Total amount of bytes pulled from a repository (egress)
- Last pulled time for a particular tag or total pulls per tag. This could help with figuring out which tags can safely be deleted and thus help with reducing storage space.
Proposal
Add an API to Gitlab CE that can receive and persist these events.
Update various release packages to include the configuration for docker registry to send events back to Gitlab CE. In local development this configuration will be added to gitlab-development-kit/registry/config.yml.example
.