Use this API to track internal events and to retrieve the Service Ping payload that GitLab collects, including its non-SQL metrics and the queries behind it.

Track usage data event

POST /api/v4/usage_data/increment_counter

This feature was introduced in GitLab 13.4.

Request body (application/json)

PropertyTypeDescription
event
Required
StringEvent name that should be tracked
Example: i_quickactions_page

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
404Not found—

Track usage data event for the current user

POST /api/v4/usage_data/increment_unique_users

Request body (application/json)

PropertyTypeDescription
event
Required
StringEvent name that should be tracked
Example: i_quickactions_page

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
404Not found—

List all non-SQL metrics

GET /api/v4/usage_data/non_sql_metrics

Lists all non-SQL metrics data used in the Service ping. Administrators only.

Responses

CodeDescriptionSchema
200OK—
401Unauthorized—
403Forbidden—
404Not Found—

List all Service Ping SQL queries

GET /api/v4/usage_data/queries

Lists all raw SQL queries used to compute Service Ping. Administrators only.

Responses

CodeDescriptionSchema
200OK—
401Unauthorized—
403Forbidden—
404Not Found—

Retrieve Service Ping payload

GET /api/v4/usage_data/service_ping

Retrieves the Service Ping payload from the application cache as JSON. If no cached payload is available, returns an empty response. Requires a personal access token with the read_service_ping scope. Introduced in GitLab 16.9.

Responses

CodeDescriptionSchema
200OK—
401401 Unauthorized—
403Forbidden—
404Not found—

Track an internal GitLab event

POST /api/v4/usage_data/track_event

Tracks a GitLab internal event. This action increments Service Ping counters in Redis and is optionally sent to Snowplow. Introduced in GitLab 16.2.

Request body (application/json)

PropertyTypeDescription
additional_propertiesObjectAdditional properties to be tracked
Example: {"label":"login_button","value":1}
event
Required
StringName of the event to track
Example: i_quickactions_page
namespace_idIntegerID of the namespace associated with the event
Example: 1234
project_idIntegerID of the project. Mutually exclusive with project_path
Example: 1234
project_pathStringPath of the project. Used to find project_id when it is not provided. Mutually exclusive with project_id
Example: namespace/project
send_to_snowplowBooleanIf true, sends the tracked event to Snowplow
Example: true

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
404Not found—

Track multiple internal GitLab events

POST /api/v4/usage_data/track_events

Tracks one or more GitLab internal events in a single request. Each event increments Service Ping counters in Redis and is optionally sent to Snowplow. This feature was introduced in GitLab 17.3.

Request body (application/json)

PropertyTypeDescription
events
Required
Array of objectsArray of internal events to track. Maximum of 50 events

Responses

CodeDescriptionSchema
200OK—
400Validation error—
401Unauthorized—