> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitors SDK Reference

> SDK reference for the Monitors API, available in Node.js and Python.

## Monitors

### List Monitors

Returns the monitors visible to the caller, newest first. A human filtering by project sees that project's monitors plus workspace-wide monitors. A project-scoped API key sees only monitors in its strict project scope. Use `starting_after` or `ending_before` to page.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.monitors.list()

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.monitors.list();

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "limit": Optional[int],
    "starting_after": Optional[str],
    "ending_before": Optional[str],
    "project_id": Optional[str],
    "search": Optional[str],
    "workspace_wide": Optional[bool],
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  limit?: number;
  startingAfter?: string;
  endingBefore?: string;
  projectId?: string;
  search?: string;
  workspaceWide?: boolean;
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "object": str,
    "data": [{
        "monitor_id": str,
        "display_name": str,
        "description": str,
        "project_id": str,
        "widgets": [{
            "widget_id": str,
            "type": Literal["timeseries", "toplist", "table", "bignumber", "donut", "breakdown"],
            "title": str,
            "queries": [{
                "source": Optional[Literal["MONITOR_TELEMETRY_SOURCE_TRACES", "MONITOR_TELEMETRY_SOURCE_METRICS", "MONITOR_TELEMETRY_SOURCE_LOGS"]],
                "metric": str,
                "operation": Optional[str],
                "group_by": List[str],  # optional
                "filters": [{  # optional
                    "field": str,
                    "op": Literal["eq", "neq", "in", "not_in", "gt", "gte", "lt", "lte", "between", "contains", "exists", "not_exists"],
                    "values": List[str],
                }],
                "grain": Optional[Literal["auto", "minute", "hour", "day"]],
                "limit": Optional[int],
                "additional_computes": [{  # optional
                    "metric": str,
                    "operation": str,
                }],
            }],
            "display": {  # optional
                "visualization": Optional[Literal["lines", "bars", "area"]],
                "unit": Optional[Literal["count", "cost", "duration", "percent", "bytes"]],
                "sort": Optional[Literal["desc", "asc"]],
                "show_overall": Optional[bool],
                "target": Optional[float],
                "decimals": Optional[int],
                "show_others": Optional[bool],
                "show_percentages": Optional[bool],
            },
            "layout": {
                "x": int,
                "y": int,
                "w": int,
                "h": int,
            },
        }],
        "default_range": Optional[Literal["5m", "15m", "30m", "1h", "6h", "12h", "1d", "7d", "14d", "30d", "60d", "90d"]],
        "preset_key": str,
        "created_at": str,
        "updated_at": str,
        "created_by_id": str,
        "updated_by_id": str,
    }],
    "has_more": bool,
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  object: string;
  data: {
    monitorId: string;
    displayName: string;
    description: string;
    projectId: string;
    widgets: {
      widgetId: string;
      type: "timeseries" | "toplist" | "table" | "bignumber" | "donut" | "breakdown";
      title: string;
      queries: {
        source?: "MONITOR_TELEMETRY_SOURCE_TRACES" | "MONITOR_TELEMETRY_SOURCE_METRICS" | "MONITOR_TELEMETRY_SOURCE_LOGS";
        metric: string;
        operation?: string;
        groupBy?: string[];
        filters?: {
          field: string;
          op: "eq" | "neq" | "in" | "not_in" | "gt" | "gte" | "lt" | "lte" | "between" | "contains" | "exists" | "not_exists";
          values: string[];
        }[];
        grain?: "auto" | "minute" | "hour" | "day";
        limit?: number;
        additionalComputes?: {
          metric: string;
          operation: string;
        }[];
      }[];
      display?: {
        visualization?: "lines" | "bars" | "area";
        unit?: "count" | "cost" | "duration" | "percent" | "bytes";
        sort?: "desc" | "asc";
        showOverall?: boolean;
        target?: number;
        decimals?: number;
        showOthers?: boolean;
        showPercentages?: boolean;
      };
      layout: {
        x: number;
        y: number;
        w: number;
        h: number;
      };
    }[];
    defaultRange?: "5m" | "15m" | "30m" | "1h" | "6h" | "12h" | "1d" | "7d" | "14d" | "30d" | "60d" | "90d";
    presetKey: string;
    createdAt: Date;
    updatedAt: Date;
    createdById: string;
    updatedById: string;
  }[];
  hasMore: boolean;
}
```

### 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.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.monitors.create(display_name="Production cost")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.monitors.create({
    displayName: "Production cost",
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "display_name": str,  # required
    "description": Optional[str],
    "project_id": Optional[str],
    "widgets": [{  # optional
        "widget_id": str,  # required
        "type": Literal["timeseries", "toplist", "table", "bignumber", "donut", "breakdown"],  # required
        "title": str,  # required
        "queries": [{  # required
            "source": Optional[Literal["MONITOR_TELEMETRY_SOURCE_TRACES", "MONITOR_TELEMETRY_SOURCE_METRICS", "MONITOR_TELEMETRY_SOURCE_LOGS"]],
            "metric": str,  # required
            "operation": Optional[str],
            "group_by": List[str],  # optional
            "filters": [{  # optional
                "field": str,  # required
                "op": Literal["eq", "neq", "in", "not_in", "gt", "gte", "lt", "lte", "between", "contains", "exists", "not_exists"],  # required
                "values": List[str],  # required
            }],
            "grain": Optional[Literal["auto", "minute", "hour", "day"]],
            "limit": Optional[int],
            "additional_computes": [{  # optional
                "metric": str,  # required
                "operation": str,  # required
            }],
        }],
        "display": {  # optional
            "visualization": Optional[Literal["lines", "bars", "area"]],
            "unit": Optional[Literal["count", "cost", "duration", "percent", "bytes"]],
            "sort": Optional[Literal["desc", "asc"]],
            "show_overall": Optional[bool],
            "target": Optional[float],
            "decimals": Optional[int],
            "show_others": Optional[bool],
            "show_percentages": Optional[bool],
        },
        "layout": {  # required
            "x": int,  # required
            "y": int,  # required
            "w": int,  # required
            "h": int,  # required
        },
    }],
    "default_range": Optional[str],
    "preset_key": Optional[Literal["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"]],
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  displayName: string;  // required
  description?: string;
  projectId?: string;
  widgets?: {
    widgetId: string;  // required
    type: "timeseries" | "toplist" | "table" | "bignumber" | "donut" | "breakdown";  // required
    title: string;  // required
    queries: {  // required
      source?: "MONITOR_TELEMETRY_SOURCE_TRACES" | "MONITOR_TELEMETRY_SOURCE_METRICS" | "MONITOR_TELEMETRY_SOURCE_LOGS";
      metric: string;  // required
      operation?: string;
      groupBy?: string[];
      filters?: {
        field: string;  // required
        op: "eq" | "neq" | "in" | "not_in" | "gt" | "gte" | "lt" | "lte" | "between" | "contains" | "exists" | "not_exists";  // required
        values: string[];  // required
      }[];
      grain?: "auto" | "minute" | "hour" | "day";
      limit?: number;
      additionalComputes?: {
        metric: string;  // required
        operation: string;  // required
      }[];
    }[];
    display?: {
      visualization?: "lines" | "bars" | "area";
      unit?: "count" | "cost" | "duration" | "percent" | "bytes";
      sort?: "desc" | "asc";
      showOverall?: boolean;
      target?: number;
      decimals?: number;
      showOthers?: boolean;
      showPercentages?: boolean;
    };
    layout: {  // required
      x: number;  // required
      y: number;  // required
      w: number;  // required
      h: number;  // required
    };
  }[];
  defaultRange?: string;
  presetKey?: "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";
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "monitor": {
        "monitor_id": str,
        "display_name": str,
        "description": str,
        "project_id": str,
        "widgets": [{
            "widget_id": str,
            "type": Literal["timeseries", "toplist", "table", "bignumber", "donut", "breakdown"],
            "title": str,
            "queries": [{
                "source": Optional[Literal["MONITOR_TELEMETRY_SOURCE_TRACES", "MONITOR_TELEMETRY_SOURCE_METRICS", "MONITOR_TELEMETRY_SOURCE_LOGS"]],
                "metric": str,
                "operation": Optional[str],
                "group_by": List[str],  # optional
                "filters": [{  # optional
                    "field": str,
                    "op": Literal["eq", "neq", "in", "not_in", "gt", "gte", "lt", "lte", "between", "contains", "exists", "not_exists"],
                    "values": List[str],
                }],
                "grain": Optional[Literal["auto", "minute", "hour", "day"]],
                "limit": Optional[int],
                "additional_computes": [{  # optional
                    "metric": str,
                    "operation": str,
                }],
            }],
            "display": {  # optional
                "visualization": Optional[Literal["lines", "bars", "area"]],
                "unit": Optional[Literal["count", "cost", "duration", "percent", "bytes"]],
                "sort": Optional[Literal["desc", "asc"]],
                "show_overall": Optional[bool],
                "target": Optional[float],
                "decimals": Optional[int],
                "show_others": Optional[bool],
                "show_percentages": Optional[bool],
            },
            "layout": {
                "x": int,
                "y": int,
                "w": int,
                "h": int,
            },
        }],
        "default_range": Optional[Literal["5m", "15m", "30m", "1h", "6h", "12h", "1d", "7d", "14d", "30d", "60d", "90d"]],
        "preset_key": str,
        "created_at": str,
        "updated_at": str,
        "created_by_id": str,
        "updated_by_id": str,
    },
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  monitor: {
    monitorId: string;
    displayName: string;
    description: string;
    projectId: string;
    widgets: {
      widgetId: string;
      type: "timeseries" | "toplist" | "table" | "bignumber" | "donut" | "breakdown";
      title: string;
      queries: {
        source?: "MONITOR_TELEMETRY_SOURCE_TRACES" | "MONITOR_TELEMETRY_SOURCE_METRICS" | "MONITOR_TELEMETRY_SOURCE_LOGS";
        metric: string;
        operation?: string;
        groupBy?: string[];
        filters?: {
          field: string;
          op: "eq" | "neq" | "in" | "not_in" | "gt" | "gte" | "lt" | "lte" | "between" | "contains" | "exists" | "not_exists";
          values: string[];
        }[];
        grain?: "auto" | "minute" | "hour" | "day";
        limit?: number;
        additionalComputes?: {
          metric: string;
          operation: string;
        }[];
      }[];
      display?: {
        visualization?: "lines" | "bars" | "area";
        unit?: "count" | "cost" | "duration" | "percent" | "bytes";
        sort?: "desc" | "asc";
        showOverall?: boolean;
        target?: number;
        decimals?: number;
        showOthers?: boolean;
        showPercentages?: boolean;
      };
      layout: {
        x: number;
        y: number;
        w: number;
        h: number;
      };
    }[];
    defaultRange?: "5m" | "15m" | "30m" | "1h" | "6h" | "12h" | "1d" | "7d" | "14d" | "30d" | "60d" | "90d";
    presetKey: string;
    createdAt: Date;
    updatedAt: Date;
    createdById: string;
    updatedById: string;
  };
}
```

### List Presets

Returns the built-in monitor templates (preset dashboards and preset widgets). Presets are defined by the platform and versioned with it; create a monitor from a preset by copying its widgets into a create request and stamping `preset_key`.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.monitors.list_presets()

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.monitors.listPresets();

  console.log(result);
}

run();
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "object": str,
    "data": [{
        "preset_key": str,
        "display_name": str,
        "description": str,
        "kind": Literal["dashboard", "widget"],
        "widgets": [{
            "widget_id": str,
            "type": Literal["timeseries", "toplist", "table", "bignumber", "donut", "breakdown"],
            "title": str,
            "queries": [{
                "source": Optional[Literal["MONITOR_TELEMETRY_SOURCE_TRACES", "MONITOR_TELEMETRY_SOURCE_METRICS", "MONITOR_TELEMETRY_SOURCE_LOGS"]],
                "metric": str,
                "operation": Optional[str],
                "group_by": List[str],  # optional
                "filters": [{  # optional
                    "field": str,
                    "op": Literal["eq", "neq", "in", "not_in", "gt", "gte", "lt", "lte", "between", "contains", "exists", "not_exists"],
                    "values": List[str],
                }],
                "grain": Optional[Literal["auto", "minute", "hour", "day"]],
                "limit": Optional[int],
                "additional_computes": [{  # optional
                    "metric": str,
                    "operation": str,
                }],
            }],
            "display": {  # optional
                "visualization": Optional[Literal["lines", "bars", "area"]],
                "unit": Optional[Literal["count", "cost", "duration", "percent", "bytes"]],
                "sort": Optional[Literal["desc", "asc"]],
                "show_overall": Optional[bool],
                "target": Optional[float],
                "decimals": Optional[int],
                "show_others": Optional[bool],
                "show_percentages": Optional[bool],
            },
            "layout": {
                "x": int,
                "y": int,
                "w": int,
                "h": int,
            },
        }],
        "default_range": Optional[Literal["5m", "15m", "30m", "1h", "6h", "12h", "1d", "7d", "14d", "30d", "60d", "90d"]],
    }],
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  object: string;
  data: {
    presetKey: string;
    displayName: string;
    description: string;
    kind: "dashboard" | "widget";
    widgets: {
      widgetId: string;
      type: "timeseries" | "toplist" | "table" | "bignumber" | "donut" | "breakdown";
      title: string;
      queries: {
        source?: "MONITOR_TELEMETRY_SOURCE_TRACES" | "MONITOR_TELEMETRY_SOURCE_METRICS" | "MONITOR_TELEMETRY_SOURCE_LOGS";
        metric: string;
        operation?: string;
        groupBy?: string[];
        filters?: {
          field: string;
          op: "eq" | "neq" | "in" | "not_in" | "gt" | "gte" | "lt" | "lte" | "between" | "contains" | "exists" | "not_exists";
          values: string[];
        }[];
        grain?: "auto" | "minute" | "hour" | "day";
        limit?: number;
        additionalComputes?: {
          metric: string;
          operation: string;
        }[];
      }[];
      display?: {
        visualization?: "lines" | "bars" | "area";
        unit?: "count" | "cost" | "duration" | "percent" | "bytes";
        sort?: "desc" | "asc";
        showOverall?: boolean;
        target?: number;
        decimals?: number;
        showOthers?: boolean;
        showPercentages?: boolean;
      };
      layout: {
        x: number;
        y: number;
        w: number;
        h: number;
      };
    }[];
    defaultRange?: "5m" | "15m" | "30m" | "1h" | "6h" | "12h" | "1d" | "7d" | "14d" | "30d" | "60d" | "90d";
  }[];
}
```

### Retrieve a Monitor

Retrieves a monitor by ID.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.monitors.get(monitor_id="<id>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.monitors.get({
    monitorId: "<id>",
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "monitor_id": str,  # required
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  monitorId: string;  // required
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "monitor": {
        "monitor_id": str,
        "display_name": str,
        "description": str,
        "project_id": str,
        "widgets": [{
            "widget_id": str,
            "type": Literal["timeseries", "toplist", "table", "bignumber", "donut", "breakdown"],
            "title": str,
            "queries": [{
                "source": Optional[Literal["MONITOR_TELEMETRY_SOURCE_TRACES", "MONITOR_TELEMETRY_SOURCE_METRICS", "MONITOR_TELEMETRY_SOURCE_LOGS"]],
                "metric": str,
                "operation": Optional[str],
                "group_by": List[str],  # optional
                "filters": [{  # optional
                    "field": str,
                    "op": Literal["eq", "neq", "in", "not_in", "gt", "gte", "lt", "lte", "between", "contains", "exists", "not_exists"],
                    "values": List[str],
                }],
                "grain": Optional[Literal["auto", "minute", "hour", "day"]],
                "limit": Optional[int],
                "additional_computes": [{  # optional
                    "metric": str,
                    "operation": str,
                }],
            }],
            "display": {  # optional
                "visualization": Optional[Literal["lines", "bars", "area"]],
                "unit": Optional[Literal["count", "cost", "duration", "percent", "bytes"]],
                "sort": Optional[Literal["desc", "asc"]],
                "show_overall": Optional[bool],
                "target": Optional[float],
                "decimals": Optional[int],
                "show_others": Optional[bool],
                "show_percentages": Optional[bool],
            },
            "layout": {
                "x": int,
                "y": int,
                "w": int,
                "h": int,
            },
        }],
        "default_range": Optional[Literal["5m", "15m", "30m", "1h", "6h", "12h", "1d", "7d", "14d", "30d", "60d", "90d"]],
        "preset_key": str,
        "created_at": str,
        "updated_at": str,
        "created_by_id": str,
        "updated_by_id": str,
    },
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  monitor: {
    monitorId: string;
    displayName: string;
    description: string;
    projectId: string;
    widgets: {
      widgetId: string;
      type: "timeseries" | "toplist" | "table" | "bignumber" | "donut" | "breakdown";
      title: string;
      queries: {
        source?: "MONITOR_TELEMETRY_SOURCE_TRACES" | "MONITOR_TELEMETRY_SOURCE_METRICS" | "MONITOR_TELEMETRY_SOURCE_LOGS";
        metric: string;
        operation?: string;
        groupBy?: string[];
        filters?: {
          field: string;
          op: "eq" | "neq" | "in" | "not_in" | "gt" | "gte" | "lt" | "lte" | "between" | "contains" | "exists" | "not_exists";
          values: string[];
        }[];
        grain?: "auto" | "minute" | "hour" | "day";
        limit?: number;
        additionalComputes?: {
          metric: string;
          operation: string;
        }[];
      }[];
      display?: {
        visualization?: "lines" | "bars" | "area";
        unit?: "count" | "cost" | "duration" | "percent" | "bytes";
        sort?: "desc" | "asc";
        showOverall?: boolean;
        target?: number;
        decimals?: number;
        showOthers?: boolean;
        showPercentages?: boolean;
      };
      layout: {
        x: number;
        y: number;
        w: number;
        h: number;
      };
    }[];
    defaultRange?: "5m" | "15m" | "30m" | "1h" | "6h" | "12h" | "1d" | "7d" | "14d" | "30d" | "60d" | "90d";
    presetKey: string;
    createdAt: Date;
    updatedAt: Date;
    createdById: string;
    updatedById: string;
  };
}
```

### Delete a Monitor

Permanently deletes a monitor. Widgets are stored inline, so no other resources are affected.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.monitors.delete(monitor_id="<id>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.monitors.delete({
    monitorId: "<id>",
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "monitor_id": str,  # required
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  monitorId: string;  // required
}
```

### 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.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.monitors.update(monitor_id="<id>", display_name="<value>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.monitors.update({
    monitorId: "<id>",
    updateMonitorRequest: {
      displayName: "<value>",
    },
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "monitor_id": str,  # required
    "display_name": Optional[str],
    "description": Optional[str],
    "widgets": [{  # optional
        "widget_id": str,  # required
        "type": Literal["timeseries", "toplist", "table", "bignumber", "donut", "breakdown"],  # required
        "title": str,  # required
        "queries": [{  # required
            "source": Optional[Literal["MONITOR_TELEMETRY_SOURCE_TRACES", "MONITOR_TELEMETRY_SOURCE_METRICS", "MONITOR_TELEMETRY_SOURCE_LOGS"]],
            "metric": str,  # required
            "operation": Optional[str],
            "group_by": List[str],  # optional
            "filters": [{  # optional
                "field": str,  # required
                "op": Literal["eq", "neq", "in", "not_in", "gt", "gte", "lt", "lte", "between", "contains", "exists", "not_exists"],  # required
                "values": List[str],  # required
            }],
            "grain": Optional[Literal["auto", "minute", "hour", "day"]],
            "limit": Optional[int],
            "additional_computes": [{  # optional
                "metric": str,  # required
                "operation": str,  # required
            }],
        }],
        "display": {  # optional
            "visualization": Optional[Literal["lines", "bars", "area"]],
            "unit": Optional[Literal["count", "cost", "duration", "percent", "bytes"]],
            "sort": Optional[Literal["desc", "asc"]],
            "show_overall": Optional[bool],
            "target": Optional[float],
            "decimals": Optional[int],
            "show_others": Optional[bool],
            "show_percentages": Optional[bool],
        },
        "layout": {  # required
            "x": int,  # required
            "y": int,  # required
            "w": int,  # required
            "h": int,  # required
        },
    }],
    "default_range": Optional[str],
    "update_mask": Optional[str],
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  monitorId: string;  // required
  updateMonitorRequest: {  // required
    displayName?: string;
    description?: string;
    widgets?: {
      widgetId: string;  // required
      type: "timeseries" | "toplist" | "table" | "bignumber" | "donut" | "breakdown";  // required
      title: string;  // required
      queries: {  // required
        source?: "MONITOR_TELEMETRY_SOURCE_TRACES" | "MONITOR_TELEMETRY_SOURCE_METRICS" | "MONITOR_TELEMETRY_SOURCE_LOGS";
        metric: string;  // required
        operation?: string;
        groupBy?: string[];
        filters?: {
          field: string;  // required
          op: "eq" | "neq" | "in" | "not_in" | "gt" | "gte" | "lt" | "lte" | "between" | "contains" | "exists" | "not_exists";  // required
          values: string[];  // required
        }[];
        grain?: "auto" | "minute" | "hour" | "day";
        limit?: number;
        additionalComputes?: {
          metric: string;  // required
          operation: string;  // required
        }[];
      }[];
      display?: {
        visualization?: "lines" | "bars" | "area";
        unit?: "count" | "cost" | "duration" | "percent" | "bytes";
        sort?: "desc" | "asc";
        showOverall?: boolean;
        target?: number;
        decimals?: number;
        showOthers?: boolean;
        showPercentages?: boolean;
      };
      layout: {  // required
        x: number;  // required
        y: number;  // required
        w: number;  // required
        h: number;  // required
      };
    }[];
    defaultRange?: string;
    updateMask?: string;
  };
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "monitor": {
        "monitor_id": str,
        "display_name": str,
        "description": str,
        "project_id": str,
        "widgets": [{
            "widget_id": str,
            "type": Literal["timeseries", "toplist", "table", "bignumber", "donut", "breakdown"],
            "title": str,
            "queries": [{
                "source": Optional[Literal["MONITOR_TELEMETRY_SOURCE_TRACES", "MONITOR_TELEMETRY_SOURCE_METRICS", "MONITOR_TELEMETRY_SOURCE_LOGS"]],
                "metric": str,
                "operation": Optional[str],
                "group_by": List[str],  # optional
                "filters": [{  # optional
                    "field": str,
                    "op": Literal["eq", "neq", "in", "not_in", "gt", "gte", "lt", "lte", "between", "contains", "exists", "not_exists"],
                    "values": List[str],
                }],
                "grain": Optional[Literal["auto", "minute", "hour", "day"]],
                "limit": Optional[int],
                "additional_computes": [{  # optional
                    "metric": str,
                    "operation": str,
                }],
            }],
            "display": {  # optional
                "visualization": Optional[Literal["lines", "bars", "area"]],
                "unit": Optional[Literal["count", "cost", "duration", "percent", "bytes"]],
                "sort": Optional[Literal["desc", "asc"]],
                "show_overall": Optional[bool],
                "target": Optional[float],
                "decimals": Optional[int],
                "show_others": Optional[bool],
                "show_percentages": Optional[bool],
            },
            "layout": {
                "x": int,
                "y": int,
                "w": int,
                "h": int,
            },
        }],
        "default_range": Optional[Literal["5m", "15m", "30m", "1h", "6h", "12h", "1d", "7d", "14d", "30d", "60d", "90d"]],
        "preset_key": str,
        "created_at": str,
        "updated_at": str,
        "created_by_id": str,
        "updated_by_id": str,
    },
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  monitor: {
    monitorId: string;
    displayName: string;
    description: string;
    projectId: string;
    widgets: {
      widgetId: string;
      type: "timeseries" | "toplist" | "table" | "bignumber" | "donut" | "breakdown";
      title: string;
      queries: {
        source?: "MONITOR_TELEMETRY_SOURCE_TRACES" | "MONITOR_TELEMETRY_SOURCE_METRICS" | "MONITOR_TELEMETRY_SOURCE_LOGS";
        metric: string;
        operation?: string;
        groupBy?: string[];
        filters?: {
          field: string;
          op: "eq" | "neq" | "in" | "not_in" | "gt" | "gte" | "lt" | "lte" | "between" | "contains" | "exists" | "not_exists";
          values: string[];
        }[];
        grain?: "auto" | "minute" | "hour" | "day";
        limit?: number;
        additionalComputes?: {
          metric: string;
          operation: string;
        }[];
      }[];
      display?: {
        visualization?: "lines" | "bars" | "area";
        unit?: "count" | "cost" | "duration" | "percent" | "bytes";
        sort?: "desc" | "asc";
        showOverall?: boolean;
        target?: number;
        decimals?: number;
        showOthers?: boolean;
        showPercentages?: boolean;
      };
      layout: {
        x: number;
        y: number;
        w: number;
        h: number;
      };
    }[];
    defaultRange?: "5m" | "15m" | "30m" | "1h" | "6h" | "12h" | "1d" | "7d" | "14d" | "30d" | "60d" | "90d";
    presetKey: string;
    createdAt: Date;
    updatedAt: Date;
    createdById: string;
    updatedById: string;
  };
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.