AIOS Métricas - Insight

AIOS Métricas - Insight

Screenshot 2025-07-07 125638.png
Swagger AIOS Metrics - https://metrics.dt-app.com/docs#/

GET /insight

Retorna um insight para a métrica

Nome

Tipo

Descrição

Padrão

Valores aceitos

Nome

Tipo

Descrição

Padrão

Valores aceitos

metric_name

string

Nome da métrica

--

Qualquer nome de métrica válido

insight_type

string

--

--

absolute | relative

pipeline_id

string

ID da pipeline a qual a métrica pertence

--

Qualquer string

component_name

string

Tipo do componente na pipeline o qual a métrica pertence

--

Qualquer componente válido para a métrica escolhida no metric_name

component_id

string

ID do componente na pipeline o qual a métrica pertence

--

Qualquer string

start_timestamp

int

Mínima timestamp na janela de tempo

0

Qualquer inteiro não-negativo

end_timestamp

int

Máxima timestamp na janela de tempo

2556143999000

Qualquer inteiro não-negativo

window_time_mode

string

Modo de filtro de janela de tempo

absolute

absolute | schedule

classes

string

Lista de classes para filtrar

[] (lista vazia)

Qualquer lista de string

**kwargs

any

Outros parâmetros requeridos pelo endpoint da métrica

Os mesmos do endpoint da métrica desejada

Os mesmos do endpoint da métrica desejada

Body

Nenhum body requerido.

Resposta

  • Response: 200 OK

  • Exceptions:

    • 500 Internal Server Error


Exemplos

Python:

import requests url = "https://metrics.dt-app.com/insight" params = { "metric_name": "your_metric_name", "insight_type": "absolute", # Available values : absolute, relative "pipeline_id": "00000000-0000-0000-0000-000000000000", "component_name": "DetectionInPolygon", # Available values : ObjectDetectionComponent, Polyline, PolylineWithDirection, DetectionInPolygon, ALPRComponent, OCRComponent, # PLCComponent, ROI, Loitering, Moni, FaceRecognition, OpticFlow, KanbanNotification, WhatsApp, RTSPStreamReceiver "component_id": "component_123", "start_timestamp": 0, "end_timestamp": 2556143999000, "window_time_mode": "absolute", # "classes": ["vehicle", "person"] # Optional } headers = { "x-api-key": "your-api-key-here", "Content-Type": "application/json" } body = {} response = requests.get(url, headers=headers, params=params, json=body) print("Status code:", response.status_code) try: print("Response JSON:", response.json()) except Exception as e: print("Error parsing JSON:", e) print("Raw response text:", response.text)

JavaScript:

const url = "https://metrics.dt-app.com/insight"; const params = { "metric_name": "your_metric_name", "insight_type": "absolute", // Available values : absolute, relative "pipeline_id": "00000000-0000-0000-0000-000000000000", "component_name": "DetectionInPolygon", //Available values : ObjectDetectionComponent, Polyline, PolylineWithDirection, DetectionInPolygon, ALPRComponent, OCRComponent, //PLCComponent, ROI, Loitering, Moni, FaceRecognition, OpticFlow, KanbanNotification, WhatsApp, RTSPStreamReceiver "start_timestamp": 0, "end_timestamp": 2556143999000, "window_time_mode": "absolute" // "classes": [] Optional }; const queryString = new URLSearchParams(params).toString(); const fullUrl = `${url}?${queryString}`; const headers = { "x-api-key": "your-api-key-here", "Content-Type": "application/json" }; const body = {}; console.log(`Sending request to: ${fullUrl}`); fetch(fullUrl, { method: 'GET', headers: headers, body: JSON.stringify(body) }) .then(response => { console.log("Status code:", response.status); if (!response.ok) { return response.text().then(text => { throw new Error(`HTTP error! status: ${response.status}, body: ${text}`); }); } return response.json(); }) .then(data => { console.log("Response JSON:", data); }) .catch(error => { console.error("Error:", error); });

Curl

curl -X GET \ 'https://metrics.dt-app.com/insight?metric_name=your_metric_name&insight_type=absolute&pipeline_id=PIPELINE_ID&component_name=DetectionInPolygon&component_id=COMPONENT_ID&start_timestamp=0&end_timestamp=2556143999000&window_time_mode=absolute' \ -H 'x-api-key: your-api-key-here' \ -H 'Content-Type: application/json' \ -d '{}'