cURL
curl --request PATCH \
--url https://my.orq.ai/v2/monitors/{monitor_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"description": "<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>",
"update_mask": "<string>"
}
'import { Orq } from '@orq-ai/node';
const orq = new Orq({ apiKey: process.env.ORQ_API_KEY });
await orq.monitors.update({ monitorId: 'monitor_01J81V5RZPVTDHXBV6M2YVJHRA', displayName: 'LLM cost (weekly)', defaultRange: '30d' });
import requests
url = "https://my.orq.ai/v2/monitors/{monitor_id}"
payload = {
"display_name": "<string>",
"description": "<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>",
"update_mask": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(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
Update a monitor
Updates monitor metadata and widgets. With update_mask, listed paths are replaced and widgets may be explicitly cleared. Without update_mask, legacy behavior is preserved: a non-empty widgets array replaces the set and an empty or omitted array keeps it. project_id is immutable.
PATCH
/
v2
/
monitors
/
{monitor_id}
cURL
curl --request PATCH \
--url https://my.orq.ai/v2/monitors/{monitor_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"description": "<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>",
"update_mask": "<string>"
}
'import { Orq } from '@orq-ai/node';
const orq = new Orq({ apiKey: process.env.ORQ_API_KEY });
await orq.monitors.update({ monitorId: 'monitor_01J81V5RZPVTDHXBV6M2YVJHRA', displayName: 'LLM cost (weekly)', defaultRange: '30d' });
import requests
url = "https://my.orq.ai/v2/monitors/{monitor_id}"
payload = {
"display_name": "<string>",
"description": "<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>",
"update_mask": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(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
Was this page helpful?