mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-18 00:56:41 +10:00
Added API endpoint for Sidekiq Metrics. ## What does this MR do? It adds an API endpoint to gather metrics about Sidekiq, it's jobs, queues, and processes. ## Why was this MR needed? There was no API endpoint for Sidekiq information. ## What are the relevant issue numbers? Fixes #7171 ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] API support added - [x] Tests - [x] Added for this feature/bug - [x] All builds are passing See merge request !4653
2.6 KiB
2.6 KiB
Sidekiq Metrics
Note: This endpoint is only available on GitLab 8.9 and above.
This API endpoint allows you to retrieve some information about the current state of Sidekiq, its jobs, queues, and processes.
Get the current Queue Metrics
List information about all the registered queues, their backlog and their latency.
GET /sidekiq/queue_metrics
curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/sidekiq/queue_metrics
Example response:
{
"queues": {
"default": {
"backlog": 0,
"latency": 0
}
}
}
Get the current Process Metrics
List information about all the Sidekiq workers registered to process your queues.
GET /sidekiq/process_metrics
curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/sidekiq/process_metrics
Example response:
{
"processes": [
{
"hostname": "gitlab.example.com",
"pid": 5649,
"tag": "gitlab",
"started_at": "2016-06-14T10:45:07.159-05:00",
"queues": [
"post_receive",
"mailers",
"archive_repo",
"system_hook",
"project_web_hook",
"gitlab_shell",
"incoming_email",
"runner",
"common",
"default"
],
"labels": [],
"concurrency": 25,
"busy": 0
}
]
}
Get the current Job Statistics
List information about the jobs that Sidekiq has performed.
GET /sidekiq/job_stats
curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/sidekiq/job_stats
Example response:
{
"jobs": {
"processed": 2,
"failed": 0,
"enqueued": 0
}
}
Get a compound response of all the previously mentioned metrics
List all the currently available information about Sidekiq.
GET /sidekiq/compound_metrics
curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/sidekiq/compound_metrics
Example response:
{
"queues": {
"default": {
"backlog": 0,
"latency": 0
}
},
"processes": [
{
"hostname": "gitlab.example.com",
"pid": 5649,
"tag": "gitlab",
"started_at": "2016-06-14T10:45:07.159-05:00",
"queues": [
"post_receive",
"mailers",
"archive_repo",
"system_hook",
"project_web_hook",
"gitlab_shell",
"incoming_email",
"runner",
"common",
"default"
],
"labels": [],
"concurrency": 25,
"busy": 0
}
],
"jobs": {
"processed": 2,
"failed": 0,
"enqueued": 0
}
}