Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10153,6 +10153,7 @@ components:
- "data-quality alert"
- "network-path alert"
- "data-jobs alert"
- "llm-observability alert"
example: "query alert"
type: string
x-enum-varnames:
Expand All @@ -10178,6 +10179,7 @@ components:
- DATA_QUALITY_ALERT
- NETWORK_PATH_ALERT
- DATA_JOBS_ALERT
- LLM_OBSERVABILITY_ALERT
MonitorUpdateRequest:
description: Object describing a monitor update request.
properties:
Expand Down
35 changes: 35 additions & 0 deletions examples/v1/monitors/CreateMonitor_1348801712.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""
Create an LLM Observability monitor returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.monitors_api import MonitorsApi
from datadog_api_client.v1.model.monitor import Monitor
from datadog_api_client.v1.model.monitor_options import MonitorOptions
from datadog_api_client.v1.model.monitor_thresholds import MonitorThresholds
from datadog_api_client.v1.model.monitor_type import MonitorType

body = Monitor(
name="Example-Monitor",
type=MonitorType.LLM_OBSERVABILITY_ALERT,
query='llm-observability("*").rollup("count").last("2h") > 0',
message="LLM observability alert triggered",
tags=[
"test:examplemonitor",
"env:ci",
],
options=MonitorOptions(
thresholds=MonitorThresholds(
critical=0.0,
),
include_tags=True,
notify_audit=False,
),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = MonitorsApi(api_client)
response = api_instance.create_monitor(body=body)

print(response)
5 changes: 4 additions & 1 deletion src/datadog_api_client/v1/model/monitor_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MonitorType(ModelSimple):
"""
The type of the monitor. For more information about `type`, see the [monitor options](https://docs.datadoghq.com/monitors/guide/monitor_api_options/) docs.

:param value: Must be one of ["composite", "event alert", "log alert", "metric alert", "process alert", "query alert", "rum alert", "service check", "synthetics alert", "trace-analytics alert", "slo alert", "event-v2 alert", "audit alert", "ci-pipelines alert", "ci-tests alert", "error-tracking alert", "database-monitoring alert", "network-performance alert", "cost alert", "data-quality alert", "network-path alert", "data-jobs alert"].
:param value: Must be one of ["composite", "event alert", "log alert", "metric alert", "process alert", "query alert", "rum alert", "service check", "synthetics alert", "trace-analytics alert", "slo alert", "event-v2 alert", "audit alert", "ci-pipelines alert", "ci-tests alert", "error-tracking alert", "database-monitoring alert", "network-performance alert", "cost alert", "data-quality alert", "network-path alert", "data-jobs alert", "llm-observability alert"].
:type value: str
"""

Expand All @@ -43,6 +43,7 @@ class MonitorType(ModelSimple):
"data-quality alert",
"network-path alert",
"data-jobs alert",
"llm-observability alert",
}
COMPOSITE: ClassVar["MonitorType"]
EVENT_ALERT: ClassVar["MonitorType"]
Expand All @@ -66,6 +67,7 @@ class MonitorType(ModelSimple):
DATA_QUALITY_ALERT: ClassVar["MonitorType"]
NETWORK_PATH_ALERT: ClassVar["MonitorType"]
DATA_JOBS_ALERT: ClassVar["MonitorType"]
LLM_OBSERVABILITY_ALERT: ClassVar["MonitorType"]

@cached_property
def openapi_types(_):
Expand Down Expand Up @@ -96,3 +98,4 @@ def openapi_types(_):
MonitorType.DATA_QUALITY_ALERT = MonitorType("data-quality alert")
MonitorType.NETWORK_PATH_ALERT = MonitorType("network-path alert")
MonitorType.DATA_JOBS_ALERT = MonitorType("data-jobs alert")
MonitorType.LLM_OBSERVABILITY_ALERT = MonitorType("llm-observability alert")
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-08-11T15:01:12.326Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
interactions:
- request:
body: '{"message":"LLM observability alert triggered","name":"Test-Create_an_LLM_Observability_monitor_returns_OK_response-1786460472","options":{"include_tags":true,"notify_audit":false,"thresholds":{"critical":0}},"query":"llm-observability(\"*\").rollup(\"count\").last(\"2h\")
> 0","tags":["test:testcreateanllmobservabilitymonitorreturnsokresponse1786460472","env:ci"],"type":"llm-observability
alert"}'
headers:
accept:
- application/json
content-type:
- application/json
method: POST
uri: https://api.datadoghq.com/api/v1/monitor
response:
body:
string: '{"id":312833678,"org_id":321813,"type":"llm-observability alert","name":"Test-Create_an_LLM_Observability_monitor_returns_OK_response-1786460472","message":"LLM
observability alert triggered","tags":["test:testcreateanllmobservabilitymonitorreturnsokresponse1786460472","env:ci"],"query":"llm-observability(\"*\").rollup(\"count\").last(\"2h\")
> 0","options":{"include_tags":true,"notify_audit":false,"thresholds":{"critical":0.0},"notify_no_data":false,"new_host_delay":300,"groupby_simple_monitor":false,"silenced":{}},"multi":false,"created_at":1786460473000,"created":"2026-08-11T15:01:13.078330+00:00","modified":"2026-08-11T15:01:13.078330+00:00","deleted":null,"priority":null,"restricted_roles":null,"restriction_policy":null,"draft_status":"published","assets":[],"overall_state_modified":null,"overall_state":"No
Data","creator":{"name":"Francesco Pighi","handle":"francesco.pighi@datadoghq.com","email":"francesco.pighi@datadoghq.com","id":21235577}}

'
headers:
content-type:
- application/json
status:
code: 200
message: OK
- request:
body: null
headers:
accept:
- application/json
method: DELETE
uri: https://api.datadoghq.com/api/v1/monitor/312833678
response:
body:
string: '{"deleted_monitor_id":312833678}

'
headers:
content-type:
- application/json
status:
code: 200
message: OK
version: 1
9 changes: 9 additions & 0 deletions tests/v1/features/monitors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ Feature: Monitors
And the response "query" is equal to "error-tracking-rum(\"service:foo AND @error.source:source\").rollup(\"count\").by(\"@issue.id\").last(\"1h\") >= 1"
And the response "draft_status" is equal to "draft"

@team:DataDog/monitor-app
Scenario: Create an LLM Observability monitor returns "OK" response
Given new "CreateMonitor" request
And body with value {"name": "{{ unique }}", "type": "llm-observability alert", "query": "llm-observability(\"*\").rollup(\"count\").last(\"2h\") > 0", "message": "LLM observability alert triggered", "tags": ["test:{{ unique_lower_alnum }}", "env:ci"], "options": {"thresholds": {"critical": 0}, "include_tags": true, "notify_audit": false}}
When the request is sent
Then the response status is 200 OK
And the response "name" is equal to "{{ unique }}"
And the response "type" is equal to "llm-observability alert"

@generated @skip @team:DataDog/monitor-app
Scenario: Delete a monitor returns "Bad Request" response
Given new "DeleteMonitor" request
Expand Down
Loading