Utilize Docker notifications to track GitLab Container Registry events via usage ping
Parent Issue : https://gitlab.com/gitlab-org/telemetry/issues/308
Problem to solve
The GitLab Container Registry allows users to build, publish and share Docker images using the Docker client or GitLab CI/CD. The problem is that we do not currently track the number of each of these events, so it is difficult to understand the Package stage's active users.
#20378 (closed) tracks events on GitLab.com via Snowplow, but does not track self-managed instances and Snowplow events are not eligible for GitLab's SMAU definition reporting.
We need to ensure that we are tracking both GitLab.com and self-managed instance events for the Container Registry.
Intended users
Further details
Docker Distribution Registry supports sending webhook notifications in response to events happening within the registry. Notifications are sent in response to manifest pushes and pulls and layer pushes and pulls.
Docker Notifications Response
Field | Type | Description |
---|---|---|
id | string | ID provides a unique identifier for the event. |
timestamp | Time | Timestamp is the time at which the event occurred. |
action | string | Action indicates what action encompasses the provided event. |
target | distribution.Descriptor | Target uniquely describes the target of the event. |
length | int | Length in bytes of content. Same as Size field in Descriptor. |
repository | string | Repository identifies the named repository. |
fromRepository | string | FromRepository identifies the named repository which a blob was mounted from if appropriate. |
url | string | URL provides a direct link to the content. |
tag | string | Tag identifies a tag name in tag events. |
request | RequestRecord | Request covers the request that generated the event. |
actor | ActorRecord. | Actor specifies the agent that initiated the event. For most situations, this could be from the authorization context of the request. |
source | SourceRecord | Source identifies the registry node that generated the event. Put differently, while the actor “initiates” the event, the source “generates” it. |
Proposal
In order to measure usage and drive AMAU / SMAU, begin to track and measure usage of the GitLab Container Registry.
- Track the below events in the Usage ping to ensure that we track self-managed instances
- Data should be tracked in Periscope in the Package stage dashboard
Events
- Number of Docker repositories added to the Container Registry
- Number of Docker images published to the Container Registry
- Number of Docker tags published to the Container Registry
Permissions and Security
- This data will be internal to GitLab to start
Documentation
- There are no documentation changes required for this change
Availability & Testing
What does success look like, and how can we measure that?
- Success looks like we are tracking these events regularly and use it to make informed product design and prioritization decisions.