Get Worker Queue Metrics
curl --request GET \
--url https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"queue_id": "<string>",
"active_workers": 123,
"idle_workers": 123,
"busy_workers": 123,
"total_workers": 123,
"tasks_processed_24h": 123,
"tasks_failed_24h": 123,
"tasks_pending": 123,
"avg_task_duration_ms": 123,
"error_rate_percent": 123,
"updated_at": "2023-11-07T05:31:56Z",
"last_error_at": "2023-11-07T05:31:56Z",
"task_queue_backlog": 0,
"task_queue_pollers": 0,
"last_activity_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}API Reference
Get Worker Queue Metrics
Get comprehensive metrics for a worker queue.
Returns worker health metrics, task statistics, and performance data.
GET
/
api
/
v1
/
worker-queues
/
{queue_id}
/
metrics
Get Worker Queue Metrics
curl --request GET \
--url https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://control-plane.kubiya.ai/api/v1/worker-queues/{queue_id}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"queue_id": "<string>",
"active_workers": 123,
"idle_workers": 123,
"busy_workers": 123,
"total_workers": 123,
"tasks_processed_24h": 123,
"tasks_failed_24h": 123,
"tasks_pending": 123,
"avg_task_duration_ms": 123,
"error_rate_percent": 123,
"updated_at": "2023-11-07T05:31:56Z",
"last_error_at": "2023-11-07T05:31:56Z",
"task_queue_backlog": 0,
"task_queue_pollers": 0,
"last_activity_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Enter your Kubiya API token (format: Bearer )
Path Parameters
Response
Successful Response
Comprehensive metrics for a worker queue
Worker queue UUID
Number of active workers
Number of idle workers
Number of busy workers
Total number of workers
Tasks completed in last 24 hours
Tasks failed in last 24 hours
Tasks currently pending
Average task duration in milliseconds
Error rate percentage
Metrics update timestamp
Timestamp of last error
Number of tasks in backlog
Number of active pollers
Last activity timestamp
Was this page helpful?