diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 7e53bd765464..39454b02d952 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -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: @@ -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: diff --git a/cassettes/features/v1/monitors/Create-an-LLM-Observability-monitor-returns-OK-response.frozen b/cassettes/features/v1/monitors/Create-an-LLM-Observability-monitor-returns-OK-response.frozen new file mode 100644 index 000000000000..f8692333568d --- /dev/null +++ b/cassettes/features/v1/monitors/Create-an-LLM-Observability-monitor-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-08-11T15:01:12.326Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Create-an-LLM-Observability-monitor-returns-OK-response.yml b/cassettes/features/v1/monitors/Create-an-LLM-Observability-monitor-returns-OK-response.yml new file mode 100644 index 000000000000..274c4ecee93e --- /dev/null +++ b/cassettes/features/v1/monitors/Create-an-LLM-Observability-monitor-returns-OK-response.yml @@ -0,0 +1,51 @@ +http_interactions: +- recorded_at: Tue, 11 Aug 2026 15:01:12 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 11 Aug 2026 15:01:12 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/monitor/312833678 + response: + body: + encoding: UTF-8 + string: '{"deleted_monitor_id":312833678} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/monitors/CreateMonitor_1348801712.rb b/examples/v1/monitors/CreateMonitor_1348801712.rb new file mode 100644 index 000000000000..b0c2cb8eb720 --- /dev/null +++ b/examples/v1/monitors/CreateMonitor_1348801712.rb @@ -0,0 +1,23 @@ +# Create an LLM Observability monitor returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::MonitorsAPI.new + +body = DatadogAPIClient::V1::Monitor.new({ + name: "Example-Monitor", + type: DatadogAPIClient::V1::MonitorType::LLM_OBSERVABILITY_ALERT, + query: 'llm-observability("*").rollup("count").last("2h") > 0', + message: "LLM observability alert triggered", + tags: [ + "test:examplemonitor", + "env:ci", + ], + options: DatadogAPIClient::V1::MonitorOptions.new({ + thresholds: DatadogAPIClient::V1::MonitorThresholds.new({ + critical: 0, + }), + include_tags: true, + notify_audit: false, + }), +}) +p api_instance.create_monitor(body) diff --git a/features/v1/monitors.feature b/features/v1/monitors.feature index 49f446a95a4f..9fc73243c7b7 100644 --- a/features/v1/monitors.feature +++ b/features/v1/monitors.feature @@ -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 diff --git a/lib/datadog_api_client/v1/models/monitor_type.rb b/lib/datadog_api_client/v1/models/monitor_type.rb index 4f7a558ca008..d79724e30d51 100644 --- a/lib/datadog_api_client/v1/models/monitor_type.rb +++ b/lib/datadog_api_client/v1/models/monitor_type.rb @@ -43,5 +43,6 @@ class MonitorType DATA_QUALITY_ALERT = "data-quality alert".freeze NETWORK_PATH_ALERT = "network-path alert".freeze DATA_JOBS_ALERT = "data-jobs alert".freeze + LLM_OBSERVABILITY_ALERT = "llm-observability alert".freeze end end