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
StringThe event 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
StringThe event 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. This action is behind the usage_data_non_sql_metrics feature flag. 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. This action is behind the usage_data_queries_api feature flag. 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
StringThe event name that should be tracked
Example: i_quickactions_page
namespace_idIntegerNamespace ID
Example: 1234
project_idIntegerProject ID. Mutually exclusive with project_path
Example: 1234
project_pathStringProject path (used to resolve project_id if not provided). Mutually exclusive with project_id
Example: namespace/project
send_to_snowplowBooleanSend 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 objectsAn array of internal events. Maximum 50 events allowed

Responses

CodeDescriptionSchema
200OK—
400Validation error—
401Unauthorized—