cURL
curl --request POST \
--url https://my.orq.ai/v2/monitors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"operation": "<string>",
"group_by": [
"<string>"
],
"filters": [
{
"field": "<string>",
"values": [
"<string>"
]
}
],
"limit": 123,
"additional_computes": [
{
"metric": "<string>",
"operation": "<string>"
}
]
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"show_overall": true,
"target": 123,
"decimals": 123,
"show_others": true,
"show_percentages": true
}
}
],
"default_range": "<string>"
}
'import { Orq } from '@orq-ai/node';
const orq = new Orq({ apiKey: process.env.ORQ_API_KEY });
await orq.monitors.create({ displayName: 'LLM cost', projectId: 'proj_01J81V5RZPVTDHXBV6M2YVJHRB', defaultRange: '7d', widgets: [{ widgetId: 'cost', type: 'timeseries', title: 'Cost by model', queries: [{ metric: 'genai.cost', groupBy: ['model'] }], layout: { x: 0, y: 0, w: 12, h: 4 } }] });
import requests
url = "https://my.orq.ai/v2/monitors"
payload = {
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"operation": "<string>",
"group_by": ["<string>"],
"filters": [
{
"field": "<string>",
"values": ["<string>"]
}
],
"limit": 123,
"additional_computes": [
{
"metric": "<string>",
"operation": "<string>"
}
]
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"show_overall": True,
"target": 123,
"decimals": 123,
"show_others": True,
"show_percentages": True
}
}
],
"default_range": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"monitor": {
"monitor_id": "<string>",
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"type": "timeseries",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"source": "MONITOR_TELEMETRY_SOURCE_TRACES",
"operation": "<string>",
"group_by": [
"<string>"
],
"filters": [
{
"field": "<string>",
"op": "eq",
"values": [
"<string>"
]
}
],
"grain": "auto",
"limit": 123,
"additional_computes": [
{
"metric": "<string>",
"operation": "<string>"
}
]
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"visualization": "lines",
"unit": "count",
"sort": "desc",
"show_overall": true,
"target": 123,
"decimals": 123,
"show_others": true,
"show_percentages": true
}
}
],
"preset_key": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_id": "<string>",
"updated_by_id": "<string>",
"default_range": "5m"
}
}{
"message": "<string>",
"code": 123,
"details": [
"<unknown>"
]
}Monitors
Create a monitor
Creates a monitor (custom observability dashboard) in the workspace. Set project_id to scope the monitor to a project; omit it to create a workspace-wide monitor, which requires admin access.
POST
/
v2
/
monitors
cURL
curl --request POST \
--url https://my.orq.ai/v2/monitors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"operation": "<string>",
"group_by": [
"<string>"
],
"filters": [
{
"field": "<string>",
"values": [
"<string>"
]
}
],
"limit": 123,
"additional_computes": [
{
"metric": "<string>",
"operation": "<string>"
}
]
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"show_overall": true,
"target": 123,
"decimals": 123,
"show_others": true,
"show_percentages": true
}
}
],
"default_range": "<string>"
}
'import { Orq } from '@orq-ai/node';
const orq = new Orq({ apiKey: process.env.ORQ_API_KEY });
await orq.monitors.create({ displayName: 'LLM cost', projectId: 'proj_01J81V5RZPVTDHXBV6M2YVJHRB', defaultRange: '7d', widgets: [{ widgetId: 'cost', type: 'timeseries', title: 'Cost by model', queries: [{ metric: 'genai.cost', groupBy: ['model'] }], layout: { x: 0, y: 0, w: 12, h: 4 } }] });
import requests
url = "https://my.orq.ai/v2/monitors"
payload = {
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"operation": "<string>",
"group_by": ["<string>"],
"filters": [
{
"field": "<string>",
"values": ["<string>"]
}
],
"limit": 123,
"additional_computes": [
{
"metric": "<string>",
"operation": "<string>"
}
]
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"show_overall": True,
"target": 123,
"decimals": 123,
"show_others": True,
"show_percentages": True
}
}
],
"default_range": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"monitor": {
"monitor_id": "<string>",
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"type": "timeseries",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"source": "MONITOR_TELEMETRY_SOURCE_TRACES",
"operation": "<string>",
"group_by": [
"<string>"
],
"filters": [
{
"field": "<string>",
"op": "eq",
"values": [
"<string>"
]
}
],
"grain": "auto",
"limit": 123,
"additional_computes": [
{
"metric": "<string>",
"operation": "<string>"
}
]
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"visualization": "lines",
"unit": "count",
"sort": "desc",
"show_overall": true,
"target": 123,
"decimals": 123,
"show_others": true,
"show_percentages": true
}
}
],
"preset_key": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_id": "<string>",
"updated_by_id": "<string>",
"default_range": "5m"
}
}{
"message": "<string>",
"code": 123,
"details": [
"<unknown>"
]
}Authorizations
Body
application/json
Known preset used to create the monitor. Empty when built from scratch.
Available options:
genai-overview, cost-analysis, latency, quality, widget-spans, widget-latency, widget-total-llm-cost, widget-token-count, widget-scores, widget-time-to-first-token, widget-tool-executions, widget-tool-error-rate, widget-tool-duration-p50 Was this page helpful?