2017-05-18 04:49:03 -04:00
|
|
|
# Sidekiq Metrics API
|
2016-06-15 12:44:45 -04:00
|
|
|
|
|
|
|
>**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.
|
|
|
|
|
2020-02-28 22:07:51 -05:00
|
|
|
```plaintext
|
2016-06-15 12:44:45 -04:00
|
|
|
GET /sidekiq/queue_metrics
|
|
|
|
```
|
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2020-05-27 20:08:37 -04:00
|
|
|
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/sidekiq/queue_metrics"
|
2016-06-15 12:44:45 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
Example response:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"queues": {
|
|
|
|
"default": {
|
|
|
|
"backlog": 0,
|
|
|
|
"latency": 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Get the current Process Metrics
|
|
|
|
|
|
|
|
List information about all the Sidekiq workers registered to process your queues.
|
|
|
|
|
2020-02-28 22:07:51 -05:00
|
|
|
```plaintext
|
2016-06-15 12:44:45 -04:00
|
|
|
GET /sidekiq/process_metrics
|
|
|
|
```
|
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2020-05-27 20:08:37 -04:00
|
|
|
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/sidekiq/process_metrics"
|
2016-06-15 12:44:45 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
Example response:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"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.
|
|
|
|
|
2020-02-28 22:07:51 -05:00
|
|
|
```plaintext
|
2016-06-15 12:44:45 -04:00
|
|
|
GET /sidekiq/job_stats
|
|
|
|
```
|
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2020-05-27 20:08:37 -04:00
|
|
|
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/sidekiq/job_stats"
|
2016-06-15 12:44:45 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
Example response:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"jobs": {
|
|
|
|
"processed": 2,
|
|
|
|
"failed": 0,
|
2019-11-18 07:06:03 -05:00
|
|
|
"enqueued": 0,
|
|
|
|
"dead": 0
|
2016-06-15 12:44:45 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Get a compound response of all the previously mentioned metrics
|
|
|
|
|
|
|
|
List all the currently available information about Sidekiq.
|
|
|
|
|
2020-02-28 22:07:51 -05:00
|
|
|
```plaintext
|
2016-06-15 12:44:45 -04:00
|
|
|
GET /sidekiq/compound_metrics
|
|
|
|
```
|
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2020-05-27 20:08:37 -04:00
|
|
|
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/sidekiq/compound_metrics"
|
2016-06-15 12:44:45 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
Example response:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"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,
|
2019-11-18 07:06:03 -05:00
|
|
|
"enqueued": 0,
|
|
|
|
"dead": 0
|
2016-06-15 12:44:45 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|