Help us learn about your current experience with the documentation. Take the survey.
Sidekiq 指标 API
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed, GitLab Dedicated
此 API 端点允许您获取 Sidekiq 当前状态、作业、队列和进程的一些信息。
获取当前队列指标
列出所有已注册队列的信息,包括它们的积压和延迟。
GET /sidekiq/queue_metricscurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/sidekiq/queue_metrics"示例响应:
{
"queues": {
"default": {
"backlog": 0,
"latency": 0
}
}
}获取当前进程指标
列出所有注册用于处理您队列的 Sidekiq 工作进程的信息。
GET /sidekiq/process_metricscurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/sidekiq/process_metrics"示例响应:
{
"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
}
]
}获取当前作业统计
列出 Sidekiq 已执行的作业信息。
GET /sidekiq/job_statscurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/sidekiq/job_stats"示例响应:
{
"jobs": {
"processed": 2,
"failed": 0,
"enqueued": 0,
"dead": 0
}
}获取所有上述指标的复合响应
列出 Sidekiq 当前所有可用信息。
GET /sidekiq/compound_metricscurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/sidekiq/compound_metrics"示例响应:
{
"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,
"dead": 0
}
}