Skip to content

Commit 5bb5c7c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add LLM Observability to ListStreamSource (#1861)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 58e7d30 commit 5bb5c7c

File tree

8 files changed

+207
-4
lines changed

8 files changed

+207
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-10-16 20:07:12.083214",
8-
"spec_repo_commit": "86072741"
7+
"regenerated": "2024-10-17 14:10:58.758527",
8+
"spec_repo_commit": "fb024a45"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-16 20:07:12.101717",
13-
"spec_repo_commit": "86072741"
12+
"regenerated": "2024-10-17 14:10:58.777345",
13+
"spec_repo_commit": "fb024a45"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4796,6 +4796,7 @@ components:
47964796
- logs_transaction_stream
47974797
- event_stream
47984798
- rum_stream
4799+
- llm_observability_stream
47994800
example: apm_issue_stream
48004801
type: string
48014802
x-enum-varnames:
@@ -4811,6 +4812,7 @@ components:
48114812
- LOGS_TRANSACTION_STREAM
48124813
- EVENT_STREAM
48134814
- RUM_STREAM
4815+
- LLM_OBSERVABILITY_STREAM
48144816
ListStreamWidgetDefinition:
48154817
description: 'The list stream visualization displays a table of recent events
48164818
in your application that
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2024-10-15T21:46:06.749Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Dashboards/Create a new dashboard with llm_observability_stream list_stream widget",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "cf641f4f8e4f7935f5b44afac4518e18",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 759,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 559,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget-1729028766 with list_stream widget\",\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"@status\",\"width\":\"compact\"},{\"field\":\"@content.prompt\",\"width\":\"auto\"},{\"field\":\"@content.response.content\",\"width\":\"auto\"},{\"field\":\"timestamp\",\"width\":\"auto\"},{\"field\":\"@ml_app\",\"width\":\"auto\"},{\"field\":\"service\",\"width\":\"auto\"},{\"field\":\"@meta.evaluations.quality\",\"width\":\"auto\"},{\"field\":\"@meta.evaluations.security\",\"width\":\"auto\"},{\"field\":\"@duration\",\"width\":\"auto\"}],\"query\":{\"data_source\":\"llm_observability_stream\",\"indexes\":[],\"query_string\":\"@event_type:span @parent_id:undefined\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"}}]}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/dashboard"
39+
},
40+
"response": {
41+
"bodySize": 1199,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 1199,
45+
"text": "{\"id\":\"k3w-qcg-ug8\",\"title\":\"Test-Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget-1729028766 with list_stream widget\",\"description\":null,\"author_handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"author_name\":\"CI Account\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/k3w-qcg-ug8/test-createanewdashboardwithllmobservabilitystreamliststreamwidget-1729028766-wi\",\"is_read_only\":false,\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"@status\",\"width\":\"compact\"},{\"field\":\"@content.prompt\",\"width\":\"auto\"},{\"field\":\"@content.response.content\",\"width\":\"auto\"},{\"field\":\"timestamp\",\"width\":\"auto\"},{\"field\":\"@ml_app\",\"width\":\"auto\"},{\"field\":\"service\",\"width\":\"auto\"},{\"field\":\"@meta.evaluations.quality\",\"width\":\"auto\"},{\"field\":\"@meta.evaluations.security\",\"width\":\"auto\"},{\"field\":\"@duration\",\"width\":\"auto\"}],\"query\":{\"data_source\":\"llm_observability_stream\",\"indexes\":[],\"query_string\":\"@event_type:span @parent_id:undefined\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"},\"id\":8221646523831060}],\"notify_list\":null,\"created_at\":\"2024-10-15T21:46:06.954265+00:00\",\"modified_at\":\"2024-10-15T21:46:06.954265+00:00\",\"restricted_roles\":[]}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 658,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2024-10-15T21:46:06.757Z",
61+
"time": 272
62+
},
63+
{
64+
"_id": "a917abb5e3048f7de7b8bd4e3f095748",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 0,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "application/json"
75+
}
76+
],
77+
"headersSize": 520,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v1/dashboard/k3w-qcg-ug8"
82+
},
83+
"response": {
84+
"bodySize": 39,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 39,
88+
"text": "{\"deleted_dashboard_id\":\"k3w-qcg-ug8\"}\n"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 656,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2024-10-15T21:46:07.036Z",
104+
"time": 222
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/**
2+
* Create a new dashboard with llm_observability_stream list_stream widget
3+
*/
4+
5+
import { client, v1 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v1.DashboardsApi(configuration);
9+
10+
const params: v1.DashboardsApiCreateDashboardRequest = {
11+
body: {
12+
layoutType: "ordered",
13+
title: "Example-Dashboard with list_stream widget",
14+
widgets: [
15+
{
16+
definition: {
17+
type: "list_stream",
18+
requests: [
19+
{
20+
responseFormat: "event_list",
21+
query: {
22+
dataSource: "llm_observability_stream",
23+
queryString: "@event_type:span @parent_id:undefined",
24+
indexes: [],
25+
},
26+
columns: [
27+
{
28+
field: "@status",
29+
width: "compact",
30+
},
31+
{
32+
field: "@content.prompt",
33+
width: "auto",
34+
},
35+
{
36+
field: "@content.response.content",
37+
width: "auto",
38+
},
39+
{
40+
field: "timestamp",
41+
width: "auto",
42+
},
43+
{
44+
field: "@ml_app",
45+
width: "auto",
46+
},
47+
{
48+
field: "service",
49+
width: "auto",
50+
},
51+
{
52+
field: "@meta.evaluations.quality",
53+
width: "auto",
54+
},
55+
{
56+
field: "@meta.evaluations.security",
57+
width: "auto",
58+
},
59+
{
60+
field: "@duration",
61+
width: "auto",
62+
},
63+
],
64+
},
65+
],
66+
},
67+
},
68+
],
69+
},
70+
};
71+
72+
apiInstance
73+
.createDashboard(params)
74+
.then((data: v1.Dashboard) => {
75+
console.log(
76+
"API called successfully. Returned data: " + JSON.stringify(data)
77+
);
78+
})
79+
.catch((error: any) => console.error(error));

features/v1/dashboards.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,14 @@ Feature: Dashboards
500500
And the response "widgets[0].definition.requests[0].query.sort.column" is equal to "timestamp"
501501
And the response "widgets[0].definition.requests[0].query.sort.order" is equal to "desc"
502502

503+
@team:DataDog/dashboards-backend
504+
Scenario: Create a new dashboard with llm_observability_stream list_stream widget
505+
Given new "CreateDashboard" request
506+
And body with value {"layout_type":"ordered","title":"{{ unique }} with list_stream widget","widgets":[{"definition":{"type":"list_stream","requests":[{"response_format":"event_list","query":{"data_source":"llm_observability_stream","query_string":"@event_type:span @parent_id:undefined","indexes":[]},"columns":[{"field":"@status","width":"compact"},{"field":"@content.prompt","width":"auto"},{"field":"@content.response.content","width":"auto"},{"field":"timestamp","width":"auto"},{"field":"@ml_app","width":"auto"},{"field":"service","width":"auto"},{"field":"@meta.evaluations.quality","width":"auto"},{"field":"@meta.evaluations.security","width":"auto"},{"field":"@duration","width":"auto"}]}]}}]}
507+
When the request is sent
508+
Then the response status is 200 OK
509+
And the response "widgets[0].definition.requests[0].query.data_source" is equal to "llm_observability_stream"
510+
503511
@team:DataDog/dashboards-backend
504512
Scenario: Create a new dashboard with log_stream widget
505513
Given new "CreateDashboard" request

packages/datadog-api-client-v1/models/ListStreamSource.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export type ListStreamSource =
2323
| typeof LOGS_TRANSACTION_STREAM
2424
| typeof EVENT_STREAM
2525
| typeof RUM_STREAM
26+
| typeof LLM_OBSERVABILITY_STREAM
2627
| UnparsedObject;
2728
export const LOGS_STREAM = "logs_stream";
2829
export const AUDIT_STREAM = "audit_stream";
@@ -36,3 +37,4 @@ export const LOGS_PATTERN_STREAM = "logs_pattern_stream";
3637
export const LOGS_TRANSACTION_STREAM = "logs_transaction_stream";
3738
export const EVENT_STREAM = "event_stream";
3839
export const RUM_STREAM = "rum_stream";
40+
export const LLM_OBSERVABILITY_STREAM = "llm_observability_stream";

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,7 @@ const enumsMap: { [key: string]: any[] } = {
899899
"logs_transaction_stream",
900900
"event_stream",
901901
"rum_stream",
902+
"llm_observability_stream",
902903
],
903904
ListStreamWidgetDefinitionType: ["list_stream"],
904905
LogStreamWidgetDefinitionType: ["log_stream"],

0 commit comments

Comments
 (0)