CI Insights
Access data from CI Insights.
Get a single runner stat as a time series #
/ci/{owner}/runners/stats/{stat} Return one of the runner stats bucketed over the requested time range, with a summary value over the full window.
Application key permission: runners: read.
stat "success_rate" | "active_runners" | "active_jobs" | "utilization_rate" | "avg_duration" | "jobs_per_hour" | "avg_jobs_per_hour" | "min_duration" | "median_duration" | "p95_duration" | "p99_duration" | "max_duration" required owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
runner_name string[] The runner name to filter on
runner_name_exclude string[] The runner name to exclude
runner_group_name string[] The runner group name to filter on
runner_group_name_exclude string[] The runner group name to exclude
runner_labels string[] The runner labels to filter on (all must match)
start string <date-time> Start of the time range: an ISO 8601 datetime with a UTC offset (e.g. 2024-01-01T00:00:00Z); a Unix timestamp or a datetime without an offset is refused. Defaults to end - 1 day when omitted; a paginated response carries the resolved value in its Link header.
end string <date-time> End of the time range: an ISO 8601 datetime with a UTC offset (e.g. 2024-01-01T00:00:00Z); a Unix timestamp or a datetime without an offset is refused. Defaults to start + 1 day when only start is provided, or now otherwise; a paginated response carries the resolved value in its Link header.
200 Successful Response
stat — 12 typesExample Response
{
"value": 0,
"value_over_time": [
{
"start": "2024-01-15T09:00:00Z",
"end": "2024-01-15T09:00:00Z",
"value": 0
}
],
"stat": "avg_duration"
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves.
Body: APIVersionUnknownBody
CI_ADMIN_ROLE_REQUIRED: Only organization admins and users with the CI Admin role can access this. APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/runners/stats/:stat" \
-H "Authorization: Bearer <token>" Get a single CI queue stat as a time series #
/ci/{owner}/queue/stats/{stat} Return one of the CI queue stats bucketed over the requested time range, with a summary value over the full window.
Application key permission: runners: read.
stat "total_jobs" | "avg_wait_time" | "min_wait_time" | "median_wait_time" | "p95_wait_time" | "p99_wait_time" | "max_wait_time" required owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
labels string[] The labels to filter on (all must match)
start string <date-time> Start of the time range: an ISO 8601 datetime with a UTC offset (e.g. 2024-01-01T00:00:00Z); a Unix timestamp or a datetime without an offset is refused. Defaults to end - 1 day when omitted; a paginated response carries the resolved value in its Link header.
end string <date-time> End of the time range: an ISO 8601 datetime with a UTC offset (e.g. 2024-01-01T00:00:00Z); a Unix timestamp or a datetime without an offset is refused. Defaults to start + 1 day when only start is provided, or now otherwise; a paginated response carries the resolved value in its Link header.
200 Successful Response
total_jobs avg_wait_time min_wait_time median_wait_time p95_wait_time p99_wait_time max_wait_timeExample Response
{
"stat": "total_jobs",
"value": 0,
"value_over_time": [
{
"start": "2024-01-15T09:00:00Z",
"end": "2024-01-15T09:00:00Z",
"value": 0
}
]
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves.
Body: APIVersionUnknownBody
CI_ADMIN_ROLE_REQUIRED: Only organization admins and users with the CI Admin role can access this. APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/queue/stats/:stat" \
-H "Authorization: Bearer <token>" Tell what happened to a repository's latest test result uploads #
/ci/{owner}/repositories/{repository}/traces-status The uploads waiting or being processed, how many of them were tried again, the last upload refused in the past 24 hours because none of its test results could be stored, and the last one Mergify gave up on in the past 24 hours.
Application key permission: tests: read.
repository string required The name of the repository
min length: 1 · max length: 100 · pattern: ^[\w\-\.]+$
owner string required The owner of the repository
min length: 1 · max length: 40 · pattern: ^[a-zA-Z0-9\-]+$
200 Successful Response
Example Response
{
"pending": {
"waiting": 0,
"processing": 0,
"retried": 0,
"oldest_waiting_received_at": "2024-01-15T09:00:00Z"
},
"last_refused": {
"refused_at": "2024-01-15T09:00:00Z",
"job_name": "string",
"reasons": [
"string"
]
},
"last_failed": {
"failed_at": "2024-01-15T09:00:00Z"
}
}
API_VERSION_UNKNOWN: The Mergify-Version header names an API version this server does not serve. served_versions lists the versions it serves.
Body: APIVersionUnknownBody
APPLICATION_KEY_REFUSED: The application key lacks the permission the request needs, or the request names an account or repository of another organization. CI_TOKEN_REFUSED: The Mergify OIDC CI token has expired, lacks the permission the request needs, or the request does not name the repository it was issued for.
Body: CredentialRefusedBody
Example Request
curl -X GET "https://api.mergify.com/v1/ci/:owner/repositories/:repository/traces-status" \
-H "Authorization: Bearer <token>" Error response bodies #
An endpoint lists each error status it returns and links to the body that comes with it.
APIVersionUnknownBody
ACTIVITY_LOG_METADATA_FILTER_NOT_INDEXED API_VERSION_NOT_NEWER API_VERSION_ROLLBACK_UNAVAILABLE API_VERSION_UNKNOWN APPLICATION_KEY_EXPIRED APPLICATION_KEY_REFUSED AUTO_QUARANTINE_CONFIG_NOT_FOUND CI_ADMIN_ROLE_REQUIRED CI_ID_TOKEN_AUDIENCE_REFUSED CI_ID_TOKEN_EXCHANGE_NOT_FOUND CI_ID_TOKEN_EXPIRED CI_ID_TOKEN_INVALID CI_ID_TOKEN_ISSUER_REFUSED CI_ID_TOKEN_ISSUER_UNAVAILABLE CI_ID_TOKEN_NO_MATCHING_TRUST_POLICY CI_ID_TOKEN_NO_TRUST_POLICY CI_ID_TOKEN_REPOSITORY_NOT_INSTALLED CI_TOKEN_REFUSED CI_TOKEN_SCOPES_TARGET_REFUSED CI_TRACES_UPLOAD_UNUSABLE CI_TRUST_POLICY_GRANT_REFUSED CI_TRUST_POLICY_LIMIT_REACHED CI_TRUST_POLICY_NAME_TAKEN CI_TRUST_POLICY_NOT_FOUND CI_TRUST_POLICY_REPOSITORY_UNKNOWN COMMAND_RESTRICTED CONFIGURATION_BRANCH_REFUSED CONFIGURATION_INVALID CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND FLAKY_DETECTION_NOT_CONFIGURED GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_TOKEN_NOT_ACCEPTED GITHUB_TWO_FACTOR_AUTHENTICATION_NONCOMPLIANT GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE INTEGRATION_NOT_CONFIGURED INVALID_CURSOR IP_ALLOW_LIST_NOT_CONFIGURED KNOWN_TESTS_BEING_COMPUTED KNOWN_TESTS_NOT_SERVED MERGE_QUEUE_DISABLED MERGE_QUEUE_POLICY_INVALID_PATTERN MERGE_QUEUE_POLICY_LIMIT_REACHED MERGE_QUEUE_POLICY_NAME_TAKEN MERGE_QUEUE_POLICY_NOT_FOUND MERGE_QUEUE_SETTING_INVALID_BRANCH_PATTERN MERGE_QUEUE_SETTING_NOT_AVAILABLE MERGE_QUEUE_SETTING_TOO_MANY_BRANCH_PATTERNS NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PULL_REQUEST_ALREADY_QUEUED PULL_REQUEST_LEAVING_QUEUE PULL_REQUEST_NOT_FOUND PULL_REQUEST_NOT_QUEUEABLE PULL_REQUEST_NOT_QUEUED PULL_REQUEST_QUEUE_REQUESTED REPOSITORY_ADMIN_ROLE_REQUIRED REPOSITORY_READ_ROLE_REQUIRED REPOSITORY_WRITE_ROLE_REQUIRED RETRY_RULE_NOT_FOUND ROLE_ALREADY_GRANTED ROLE_CHANGE_REFUSED ROLE_GRANTEE_REFUSED ROLE_GRANT_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SCHEDULED_FREEZE_NOT_FOUND SCOPES_COVERAGE_GLOB_TOO_COSTLY SCOPES_COVERAGE_MANUAL_SOURCE SCOPES_COVERAGE_PATH_NOT_FOUND SCOPES_COVERAGE_UNAVAILABLE SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH STAFF_SESSION_REFUSED STATISTICS_SCOPE_PERIOD_TOO_LARGE SUBSCRIPTION_API_UNAVAILABLE SUBSCRIPTION_FEATURE_REQUIRED SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINED TEST_BRANCH_NOT_TRACKED TEST_FAILURE_NOT_FOUND TEST_NOT_FOUND TEST_RESULTS_INGESTION_NOT_ENABLED TEST_RETRY_NOT_CONFIGURED TEST_STATE_NOT_FOUND TEST_STATE_OVERLAPExample Response
{
"detail": "string",
"error_code": "ACTIVITY_LOG_METADATA_FILTER_NOT_INDEXED",
"documentation_url": "string",
"served_versions": [
"string"
]
}
CredentialRefusedBody
ACTIVITY_LOG_METADATA_FILTER_NOT_INDEXED API_VERSION_NOT_NEWER API_VERSION_ROLLBACK_UNAVAILABLE API_VERSION_UNKNOWN APPLICATION_KEY_EXPIRED APPLICATION_KEY_REFUSED AUTO_QUARANTINE_CONFIG_NOT_FOUND CI_ADMIN_ROLE_REQUIRED CI_ID_TOKEN_AUDIENCE_REFUSED CI_ID_TOKEN_EXCHANGE_NOT_FOUND CI_ID_TOKEN_EXPIRED CI_ID_TOKEN_INVALID CI_ID_TOKEN_ISSUER_REFUSED CI_ID_TOKEN_ISSUER_UNAVAILABLE CI_ID_TOKEN_NO_MATCHING_TRUST_POLICY CI_ID_TOKEN_NO_TRUST_POLICY CI_ID_TOKEN_REPOSITORY_NOT_INSTALLED CI_TOKEN_REFUSED CI_TOKEN_SCOPES_TARGET_REFUSED CI_TRACES_UPLOAD_UNUSABLE CI_TRUST_POLICY_GRANT_REFUSED CI_TRUST_POLICY_LIMIT_REACHED CI_TRUST_POLICY_NAME_TAKEN CI_TRUST_POLICY_NOT_FOUND CI_TRUST_POLICY_REPOSITORY_UNKNOWN COMMAND_RESTRICTED CONFIGURATION_BRANCH_REFUSED CONFIGURATION_INVALID CONFIGURATION_REFUSED_BY_REPOSITORY_RULES CONFIGURATION_SIGNED_COMMITS_REQUIRED DEFAULT_BRANCH_NOT_FOUND FLAKY_DETECTION_NOT_CONFIGURED GITHUB_ACCOUNT_SUSPENDED GITHUB_APP_ACCESS_LOST GITHUB_RATE_LIMITED GITHUB_TOKEN_NOT_ACCEPTED GITHUB_TWO_FACTOR_AUTHENTICATION_NONCOMPLIANT GITHUB_UPSTREAM_REQUEST_FORBIDDEN GITHUB_UPSTREAM_REQUEST_REJECTED GITHUB_UPSTREAM_UNAVAILABLE INTEGRATION_NOT_CONFIGURED INVALID_CURSOR IP_ALLOW_LIST_NOT_CONFIGURED KNOWN_TESTS_BEING_COMPUTED KNOWN_TESTS_NOT_SERVED MERGE_QUEUE_DISABLED MERGE_QUEUE_POLICY_INVALID_PATTERN MERGE_QUEUE_POLICY_LIMIT_REACHED MERGE_QUEUE_POLICY_NAME_TAKEN MERGE_QUEUE_POLICY_NOT_FOUND MERGE_QUEUE_SETTING_INVALID_BRANCH_PATTERN MERGE_QUEUE_SETTING_NOT_AVAILABLE MERGE_QUEUE_SETTING_TOO_MANY_BRANCH_PATTERNS NO_LOGIN_IN_PROGRESS ORGANIZATION_MEMBERS_ONLY PULL_REQUEST_ALREADY_QUEUED PULL_REQUEST_LEAVING_QUEUE PULL_REQUEST_NOT_FOUND PULL_REQUEST_NOT_QUEUEABLE PULL_REQUEST_NOT_QUEUED PULL_REQUEST_QUEUE_REQUESTED REPOSITORY_ADMIN_ROLE_REQUIRED REPOSITORY_READ_ROLE_REQUIRED REPOSITORY_WRITE_ROLE_REQUIRED RETRY_RULE_NOT_FOUND ROLE_ALREADY_GRANTED ROLE_CHANGE_REFUSED ROLE_GRANTEE_REFUSED ROLE_GRANT_NOT_FOUND SAML_ENFORCEMENT_NOT_AUTHORIZED SCHEDULED_FREEZE_NOT_FOUND SCOPES_COVERAGE_GLOB_TOO_COSTLY SCOPES_COVERAGE_MANUAL_SOURCE SCOPES_COVERAGE_PATH_NOT_FOUND SCOPES_COVERAGE_UNAVAILABLE SETTING_MANAGED_BY_ENV SETUP_ALREADY_DONE SETUP_TOKEN_MISMATCH STAFF_SESSION_REFUSED STATISTICS_SCOPE_PERIOD_TOO_LARGE SUBSCRIPTION_API_UNAVAILABLE SUBSCRIPTION_FEATURE_REQUIRED SUBSCRIPTION_INACTIVE SUBSCRIPTION_TOKEN_INVALID TEST_ALREADY_QUARANTINED TEST_BRANCH_NOT_TRACKED TEST_FAILURE_NOT_FOUND TEST_NOT_FOUND TEST_RESULTS_INGESTION_NOT_ENABLED TEST_RETRY_NOT_CONFIGURED TEST_STATE_NOT_FOUND TEST_STATE_OVERLAPExample Response
{
"detail": "string",
"error_code": "ACTIVITY_LOG_METADATA_FILTER_NOT_INDEXED",
"documentation_url": "string",
"accepted_permissions": [
{
"resource": "merge_queue",
"access": "read"
}
]
}
Was this page helpful?
Thanks for your feedback!