Sidekiq メトリクスAPI
注意:このエンドポイントは GitLab 8.9 以降でのみ利用可能です。
このAPIエンドポイントを使用すると、Sidekiqの現在の状態、ジョブ、キュー、およびプロセスに関する情報を取得できます。
現在のキューメトリクスの取得
登録されているすべてのキュー、それらのバックログ、およびそれらの待ち時間に関する情報を一覧表示します。
GET /sidekiq/queue_metrics
curl --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_metrics
curl --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_stats
curl --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_metrics
curl --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
}
}