curl --request GET \
--url https://platformapi.comfy.org/deploy/v1/deployments/{id}/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://platformapi.comfy.org/deploy/v1/deployments/{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://platformapi.comfy.org/deploy/v1/deployments/{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://platformapi.comfy.org/deploy/v1/deployments/{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://platformapi.comfy.org/deploy/v1/deployments/{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://platformapi.comfy.org/deploy/v1/deployments/{id}/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://platformapi.comfy.org/deploy/v1/deployments/{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{
"enabled": false
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Read a deployment's named metrics over a window
Beta. For the workspace’s own Metrics tab: job outcomes, failure categories, submissions and timing over a window of up to 7 days. Nothing after the request time (readAt) is read, but the window is aligned to the step, so its last bucket can end after that time. A call with no parameters reads the last 24 hours at a 3,600-second step, every metric, summaries and series, and the previous total. Never cached: the response says Cache-Control: private, no-store.
The window comes from range, or from start and end together in UTC, and is aligned to the step: a range ends at now rounded up to the step, and an explicit start rounds down and end up. The answer echoes the window it used and lists each bucket’s start once in timestamps; every series has one value per timestamp, null where nothing was counted or observed. Send each parameter once. Names and values are lowercase, a name repeated inside a list counts once, and unknown parameter names are ignored. Each of these answers 400 INVALID_REQUEST with a message naming the parameter: an unknown or empty value, a repeated parameter, range with start or end, one of start and end alone, a time not in UTC, start not before end (an end after now is cut to now first), a step longer than the window, a window under 60 seconds with no step, a window that, once aligned to the step, starts over 14 days before now, spans over 7 days or holds over 1,440 buckets.
A metric that could not be read is left out of metrics and listed in unavailable, partial is true, and the status stays 200.
Refuses an API key with 401, so only a signed-in workspace member reads it. Another workspace’s deployment, a running copy’s own id and an id that does not exist all answer 404, before anything is read.
Can be switched off per workspace with the same flag as the status route. Switched off, this is still a 200 with enabled false and no other field. The switch is read before the API key refusal, the ownership check and the parameter checks, so a valid API key and any id also get that 200.
curl --request GET \
--url https://platformapi.comfy.org/deploy/v1/deployments/{id}/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://platformapi.comfy.org/deploy/v1/deployments/{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://platformapi.comfy.org/deploy/v1/deployments/{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://platformapi.comfy.org/deploy/v1/deployments/{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://platformapi.comfy.org/deploy/v1/deployments/{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://platformapi.comfy.org/deploy/v1/deployments/{id}/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://platformapi.comfy.org/deploy/v1/deployments/{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{
"enabled": false
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}쿼리 매개변수
A comma-separated list from jobs, failure_categories, expired_at_worker_maximum, submissions, job_duration, worker_maximum_waits and job_time_split. Absent, those seven; a metric added later comes back only when named.
cold_start is also accepted, outside those seven and only on its own: named with another metric it answers 400. It answers the cold start row alone, in seconds, as one summary item equal to the cold_start item of job_duration, and with include=series alone only its unit. It waits up to 10 seconds for the metrics store, where every other metric waits 1.8 seconds, and is listed unavailable as datadog_slow if the store has not answered by then. The call spends one request of the workspace's allowance, and compare does not apply to it.