Skip to content

Commit b8b2bcf

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 68368962 of spec repo
1 parent dab2b64 commit b8b2bcf

File tree

7 files changed

+164
-16
lines changed

7 files changed

+164
-16
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-10 19:46:01.049645",
8-
"spec_repo_commit": "049920eb"
7+
"regenerated": "2024-10-15 22:01:18.100390",
8+
"spec_repo_commit": "68368962"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-10 19:46:01.068188",
13-
"spec_repo_commit": "049920eb"
12+
"regenerated": "2024-10-15 22:01:18.119588",
13+
"spec_repo_commit": "68368962"
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

api/datadogV1/model_list_stream_source.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ type ListStreamSource string
1515

1616
// List of ListStreamSource.
1717
const (
18-
LISTSTREAMSOURCE_LOGS_STREAM ListStreamSource = "logs_stream"
19-
LISTSTREAMSOURCE_AUDIT_STREAM ListStreamSource = "audit_stream"
20-
LISTSTREAMSOURCE_CI_PIPELINE_STREAM ListStreamSource = "ci_pipeline_stream"
21-
LISTSTREAMSOURCE_CI_TEST_STREAM ListStreamSource = "ci_test_stream"
22-
LISTSTREAMSOURCE_RUM_ISSUE_STREAM ListStreamSource = "rum_issue_stream"
23-
LISTSTREAMSOURCE_APM_ISSUE_STREAM ListStreamSource = "apm_issue_stream"
24-
LISTSTREAMSOURCE_TRACE_STREAM ListStreamSource = "trace_stream"
25-
LISTSTREAMSOURCE_LOGS_ISSUE_STREAM ListStreamSource = "logs_issue_stream"
26-
LISTSTREAMSOURCE_LOGS_PATTERN_STREAM ListStreamSource = "logs_pattern_stream"
27-
LISTSTREAMSOURCE_LOGS_TRANSACTION_STREAM ListStreamSource = "logs_transaction_stream"
28-
LISTSTREAMSOURCE_EVENT_STREAM ListStreamSource = "event_stream"
29-
LISTSTREAMSOURCE_RUM_STREAM ListStreamSource = "rum_stream"
18+
LISTSTREAMSOURCE_LOGS_STREAM ListStreamSource = "logs_stream"
19+
LISTSTREAMSOURCE_AUDIT_STREAM ListStreamSource = "audit_stream"
20+
LISTSTREAMSOURCE_CI_PIPELINE_STREAM ListStreamSource = "ci_pipeline_stream"
21+
LISTSTREAMSOURCE_CI_TEST_STREAM ListStreamSource = "ci_test_stream"
22+
LISTSTREAMSOURCE_RUM_ISSUE_STREAM ListStreamSource = "rum_issue_stream"
23+
LISTSTREAMSOURCE_APM_ISSUE_STREAM ListStreamSource = "apm_issue_stream"
24+
LISTSTREAMSOURCE_TRACE_STREAM ListStreamSource = "trace_stream"
25+
LISTSTREAMSOURCE_LOGS_ISSUE_STREAM ListStreamSource = "logs_issue_stream"
26+
LISTSTREAMSOURCE_LOGS_PATTERN_STREAM ListStreamSource = "logs_pattern_stream"
27+
LISTSTREAMSOURCE_LOGS_TRANSACTION_STREAM ListStreamSource = "logs_transaction_stream"
28+
LISTSTREAMSOURCE_EVENT_STREAM ListStreamSource = "event_stream"
29+
LISTSTREAMSOURCE_RUM_STREAM ListStreamSource = "rum_stream"
30+
LISTSTREAMSOURCE_LLM_OBSERVABILITY_STREAM ListStreamSource = "llm_observability_stream"
3031
)
3132

3233
var allowedListStreamSourceEnumValues = []ListStreamSource{
@@ -42,6 +43,7 @@ var allowedListStreamSourceEnumValues = []ListStreamSource{
4243
LISTSTREAMSOURCE_LOGS_TRANSACTION_STREAM,
4344
LISTSTREAMSOURCE_EVENT_STREAM,
4445
LISTSTREAMSOURCE_RUM_STREAM,
46+
LISTSTREAMSOURCE_LLM_OBSERVABILITY_STREAM,
4547
}
4648

4749
// GetAllowedValues reeturns the list of possible values.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
// Create a new dashboard with llm_observability_stream list_stream widget
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"encoding/json"
8+
"fmt"
9+
"os"
10+
11+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
12+
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
13+
)
14+
15+
func main() {
16+
body := datadogV1.Dashboard{
17+
LayoutType: datadogV1.DASHBOARDLAYOUTTYPE_ORDERED,
18+
Title: "Example-Dashboard with list_stream widget",
19+
Widgets: []datadogV1.Widget{
20+
{
21+
Definition: datadogV1.WidgetDefinition{
22+
ListStreamWidgetDefinition: &datadogV1.ListStreamWidgetDefinition{
23+
Type: datadogV1.LISTSTREAMWIDGETDEFINITIONTYPE_LIST_STREAM,
24+
Requests: []datadogV1.ListStreamWidgetRequest{
25+
{
26+
ResponseFormat: datadogV1.LISTSTREAMRESPONSEFORMAT_EVENT_LIST,
27+
Query: datadogV1.ListStreamQuery{
28+
DataSource: datadogV1.LISTSTREAMSOURCE_LLM_OBSERVABILITY_STREAM,
29+
QueryString: "@event_type:span @parent_id:undefined",
30+
Indexes: []string{},
31+
},
32+
Columns: []datadogV1.ListStreamColumn{
33+
{
34+
Field: "@status",
35+
Width: datadogV1.LISTSTREAMCOLUMNWIDTH_COMPACT,
36+
},
37+
{
38+
Field: "@content.prompt",
39+
Width: datadogV1.LISTSTREAMCOLUMNWIDTH_AUTO,
40+
},
41+
{
42+
Field: "@content.response.content",
43+
Width: datadogV1.LISTSTREAMCOLUMNWIDTH_AUTO,
44+
},
45+
{
46+
Field: "timestamp",
47+
Width: datadogV1.LISTSTREAMCOLUMNWIDTH_AUTO,
48+
},
49+
{
50+
Field: "@ml_app",
51+
Width: datadogV1.LISTSTREAMCOLUMNWIDTH_AUTO,
52+
},
53+
{
54+
Field: "service",
55+
Width: datadogV1.LISTSTREAMCOLUMNWIDTH_AUTO,
56+
},
57+
{
58+
Field: "@meta.evaluations.quality",
59+
Width: datadogV1.LISTSTREAMCOLUMNWIDTH_AUTO,
60+
},
61+
{
62+
Field: "@meta.evaluations.security",
63+
Width: datadogV1.LISTSTREAMCOLUMNWIDTH_AUTO,
64+
},
65+
{
66+
Field: "@duration",
67+
Width: datadogV1.LISTSTREAMCOLUMNWIDTH_AUTO,
68+
},
69+
},
70+
},
71+
},
72+
}},
73+
},
74+
},
75+
}
76+
ctx := datadog.NewDefaultContext(context.Background())
77+
configuration := datadog.NewConfiguration()
78+
apiClient := datadog.NewAPIClient(configuration)
79+
api := datadogV1.NewDashboardsApi(apiClient)
80+
resp, r, err := api.CreateDashboard(ctx, body)
81+
82+
if err != nil {
83+
fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.CreateDashboard`: %v\n", err)
84+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
85+
}
86+
87+
responseContent, _ := json.MarshalIndent(resp, "", " ")
88+
fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.CreateDashboard`:\n%s\n", responseContent)
89+
}
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,46 @@
1+
interactions:
2+
- request:
3+
body: |
4+
{"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"}}]}
5+
form: {}
6+
headers:
7+
Accept:
8+
- application/json
9+
Content-Type:
10+
- application/json
11+
id: 0
12+
method: POST
13+
url: https://api.datadoghq.com/api/v1/dashboard
14+
response:
15+
body: '{"id":"k3w-qcg-ug8","title":"Test-Create_a_new_dashboard_with_llm_observability_stream_list_stream_widget-1729028766
16+
with list_stream widget","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI
17+
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
18+
@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":[]}
19+
20+
'
21+
code: 200
22+
duration: 0ms
23+
headers:
24+
Content-Type:
25+
- application/json
26+
status: 200 OK
27+
- request:
28+
body: ''
29+
form: {}
30+
headers:
31+
Accept:
32+
- application/json
33+
id: 1
34+
method: DELETE
35+
url: https://api.datadoghq.com/api/v1/dashboard/k3w-qcg-ug8
36+
response:
37+
body: '{"deleted_dashboard_id":"k3w-qcg-ug8"}
38+
39+
'
40+
code: 200
41+
duration: 0ms
42+
headers:
43+
Content-Type:
44+
- application/json
45+
status: 200 OK
46+
version: 2

tests/scenarios/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

0 commit comments

Comments
 (0)