Skip to content

Commit 9867c6f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add product analytics to FormulaAndFunctionEventsDataSource (#2794)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 9bbe7cf commit 9867c6f

File tree

8 files changed

+128
-0
lines changed

8 files changed

+128
-0
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,6 +2875,7 @@ components:
28752875
- ci_tests
28762876
- ci_pipelines
28772877
- incident_analytics
2878+
- product_analytics
28782879
example: logs
28792880
type: string
28802881
x-enum-varnames:
@@ -2889,6 +2890,7 @@ components:
28892890
- CI_TESTS
28902891
- CI_PIPELINES
28912892
- INCIDENT_ANALYTICS
2893+
- PRODUCT_ANALYTICS
28922894
FormulaAndFunctionMetricAggregation:
28932895
description: The aggregation methods available for metrics queries.
28942896
enum:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-09-18T18:51:17.951Z"
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Dashboards/Create a new timeseries widget with product_analytics data source",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "8fcc4923c4ef8c94eabcb970afb3a8e2",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 678,
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\",\"reflow_type\":\"auto\",\"title\":\"Test-Create_a_new_timeseries_widget_with_product_analytics_data_source-1758221477 with product_analytics datasource\",\"widgets\":[{\"definition\":{\"legend_columns\":[\"avg\",\"min\",\"max\",\"value\",\"sum\"],\"legend_layout\":\"auto\",\"requests\":[{\"display_type\":\"line\",\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"product_analytics\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"test_level:test\"}}],\"response_format\":\"timeseries\",\"style\":{\"line_type\":\"solid\",\"line_width\":\"normal\",\"palette\":\"dog_classic\"}}],\"show_legend\":true,\"time\":{},\"title\":\"\",\"type\":\"timeseries\"}}]}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/dashboard"
39+
},
40+
"response": {
41+
"bodySize": 1096,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 1096,
45+
"text": "{\"id\":\"zvr-td5-ppm\",\"title\":\"Test-Create_a_new_timeseries_widget_with_product_analytics_data_source-1758221477 with product_analytics datasource\",\"description\":null,\"author_handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"author_name\":\"CI Account\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/zvr-td5-ppm/test-createanewtimeserieswidgetwithproductanalyticsdatasource-1758221477-with-pr\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"legend_columns\":[\"avg\",\"min\",\"max\",\"value\",\"sum\"],\"legend_layout\":\"auto\",\"requests\":[{\"display_type\":\"line\",\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"product_analytics\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"test_level:test\"}}],\"response_format\":\"timeseries\",\"style\":{\"line_type\":\"solid\",\"line_width\":\"normal\",\"palette\":\"dog_classic\"}}],\"show_legend\":true,\"time\":{},\"title\":\"\",\"type\":\"timeseries\"},\"id\":6058978575853641}],\"notify_list\":null,\"created_at\":\"2025-09-18T18:51:18.107135+00:00\",\"modified_at\":\"2025-09-18T18:51:18.107135+00:00\",\"reflow_type\":\"auto\",\"restricted_roles\":[]}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 381,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2025-09-18T18:51:17.959Z",
61+
"time": 209
62+
},
63+
{
64+
"_id": "b2bcdc4b8964a91c4df0a3bfb46ad9f5",
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/zvr-td5-ppm"
82+
},
83+
"response": {
84+
"bodySize": 39,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 39,
88+
"text": "{\"deleted_dashboard_id\":\"zvr-td5-ppm\"}\n"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 687,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2025-09-18T18:51:18.176Z",
104+
"time": 239
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}

features/v1/dashboards.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,15 @@ Feature: Dashboards
950950
And the response "widgets[0].definition.time.value" is equal to 8
951951
And the response "widgets[0].definition.time.hide_incomplete_cost_data" is equal to true
952952

953+
@team:DataDog/dashboards-backend
954+
Scenario: Create a new timeseries widget with product_analytics data source
955+
Given new "CreateDashboard" request
956+
And body with value {"title":"{{ unique }} with product_analytics datasource","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"product_analytics","name":"query1","search":{"query":"test_level:test"},"indexes":["*"],"compute":{"aggregation":"count"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"}
957+
When the request is sent
958+
Then the response status is 200 OK
959+
And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "product_analytics"
960+
And the response "widgets[0].definition.requests[0].queries[0].search.query" is equal to "test_level:test"
961+
953962
@generated @skip @team:DataDog/reporting-and-sharing
954963
Scenario: Create a shared dashboard returns "Bad Request" response
955964
Given new "CreatePublicDashboard" request

services/dashboards/src/v1/models/FormulaAndFunctionEventsDataSource.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export type FormulaAndFunctionEventsDataSource =
1515
| typeof CI_TESTS
1616
| typeof CI_PIPELINES
1717
| typeof INCIDENT_ANALYTICS
18+
| typeof PRODUCT_ANALYTICS
1819
| UnparsedObject;
1920
export const LOGS = "logs";
2021
export const SPANS = "spans";
@@ -27,3 +28,4 @@ export const EVENTS = "events";
2728
export const CI_TESTS = "ci_tests";
2829
export const CI_PIPELINES = "ci_pipelines";
2930
export const INCIDENT_ANALYTICS = "incident_analytics";
31+
export const PRODUCT_ANALYTICS = "product_analytics";

services/dashboards/src/v1/models/TypingInfo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ export const TypingInfo: ModelTypingInfo = {
234234
"ci_tests",
235235
"ci_pipelines",
236236
"incident_analytics",
237+
"product_analytics",
237238
],
238239
FormulaAndFunctionMetricAggregation: [
239240
"avg",

services/notebooks/src/v1/models/FormulaAndFunctionEventsDataSource.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export type FormulaAndFunctionEventsDataSource =
1515
| typeof CI_TESTS
1616
| typeof CI_PIPELINES
1717
| typeof INCIDENT_ANALYTICS
18+
| typeof PRODUCT_ANALYTICS
1819
| UnparsedObject;
1920
export const LOGS = "logs";
2021
export const SPANS = "spans";
@@ -27,3 +28,4 @@ export const EVENTS = "events";
2728
export const CI_TESTS = "ci_tests";
2829
export const CI_PIPELINES = "ci_pipelines";
2930
export const INCIDENT_ANALYTICS = "incident_analytics";
31+
export const PRODUCT_ANALYTICS = "product_analytics";

services/notebooks/src/v1/models/TypingInfo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ export const TypingInfo: ModelTypingInfo = {
144144
"ci_tests",
145145
"ci_pipelines",
146146
"incident_analytics",
147+
"product_analytics",
147148
],
148149
FormulaAndFunctionMetricAggregation: [
149150
"avg",

0 commit comments

Comments
 (0)