Use Docker notifications to track GitLab Container Registry events on GitLab.com (Snowplow)
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 measure this data in our product analytics dashboards. This makes it difficult to understand the Package stage's active users at the stage and organizational level.
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 adoption of the GitLab Container Registry, track key Container Registry events on GitLab.com by adding these events to Snowplow.
- Data should be tracked in Periscope in the Package stage dashboard
Events (counts only)
-
push_tag
:tags published to the regsistry -
delete_tag
:tags deleted from the registry -
push_repository
:Docker repositories pushed to the registry -
delete_repository
(*):Docker repositories deleted from the registry -
create_repository
Docker repositories created in the registry
(*): This event delete_repository
was not observed during my tests locally on my machine.
Snowplow vs. Usage Ping
- Since Snowplow is a faster implementation, we will prioritize that first and focus on correctly tracking/parsing the data. Then we will add support for usage ping.
- #205833 will add tracking to the usage ping for opted in instances.
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.