Skip to content

[RUM] Use a randomized id for metrics creation scenarios. #2265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-23 12:48:23.752850",
"spec_repo_commit": "11a9dcb4"
"regenerated": "2025-05-23 14:41:15.166535",
"spec_repo_commit": "a4ecd4cf"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-23 12:48:23.769415",
"spec_repo_commit": "11a9dcb4"
"regenerated": "2025-05-23 14:41:15.182511",
"spec_repo_commit": "a4ecd4cf"
}
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2024-11-28T15:31:19.388Z"
"2025-05-22T06:41:46.880Z"
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
},
"entries": [
{
"_id": "a60dcd3f6b4261be976b55b839c23015",
"_id": "5e0d2db15a24b26de971a05af71e7ec8",
"_order": 0,
"cache": {},
"request": {
"bodySize": 324,
"bodySize": 357,
"cookies": [],
"headers": [
{
Expand All @@ -32,17 +32,17 @@
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"data\":{\"attributes\":{\"compute\":{\"aggregation_type\":\"distribution\",\"include_percentiles\":true,\"path\":\"@duration\"},\"event_type\":\"session\",\"filter\":{\"query\":\"@service:web-ui\"},\"group_by\":[{\"path\":\"@browser.name\",\"tag_name\":\"browser_name\"}],\"uniqueness\":{\"when\":\"match\"}},\"id\":\"rum.sessions.webui.count\",\"type\":\"rum_metrics\"}}"
"text": "{\"data\":{\"attributes\":{\"compute\":{\"aggregation_type\":\"distribution\",\"include_percentiles\":true,\"path\":\"@duration\"},\"event_type\":\"session\",\"filter\":{\"query\":\"@service:web-ui\"},\"group_by\":[{\"path\":\"@browser.name\",\"tag_name\":\"browser_name\"}],\"uniqueness\":{\"when\":\"match\"}},\"id\":\"testcreatearumbasedmetricreturnscreatedresponse1747896106\",\"type\":\"rum_metrics\"}}"
},
"queryString": [],
"url": "https://api.datadoghq.com/api/v2/rum/config/metrics"
},
"response": {
"bodySize": 324,
"bodySize": 357,
"content": {
"mimeType": "application/vnd.api+json",
"size": 324,
"text": "{\"data\":{\"id\":\"rum.sessions.webui.count\",\"type\":\"rum_metrics\",\"attributes\":{\"compute\":{\"aggregation_type\":\"distribution\",\"include_percentiles\":true,\"path\":\"@duration\"},\"event_type\":\"session\",\"filter\":{\"query\":\"@service:web-ui\"},\"group_by\":[{\"path\":\"@browser.name\",\"tag_name\":\"browser_name\"}],\"uniqueness\":{\"when\":\"match\"}}}}"
"size": 357,
"text": "{\"data\":{\"id\":\"testcreatearumbasedmetricreturnscreatedresponse1747896106\",\"type\":\"rum_metrics\",\"attributes\":{\"compute\":{\"aggregation_type\":\"distribution\",\"include_percentiles\":true,\"path\":\"@duration\"},\"event_type\":\"session\",\"filter\":{\"query\":\"@service:web-ui\"},\"group_by\":[{\"path\":\"@browser.name\",\"tag_name\":\"browser_name\"}],\"uniqueness\":{\"when\":\"match\"}}}}"
},
"cookies": [],
"headers": [
Expand All @@ -57,11 +57,11 @@
"status": 201,
"statusText": "Created"
},
"startedDateTime": "2024-11-28T15:31:19.392Z",
"time": 428
"startedDateTime": "2025-05-22T06:41:46.882Z",
"time": 691
},
{
"_id": "f43cd3bd54eab63671dcc9e06bea290c",
"_id": "4afe641ae95c2475bc3a29853567e435",
"_order": 0,
"cache": {},
"request": {
Expand All @@ -74,11 +74,11 @@
"value": "*/*"
}
],
"headersSize": 529,
"headersSize": 562,
"httpVersion": "HTTP/1.1",
"method": "DELETE",
"queryString": [],
"url": "https://api.datadoghq.com/api/v2/rum/config/metrics/rum.sessions.webui.count"
"url": "https://api.datadoghq.com/api/v2/rum/config/metrics/testcreatearumbasedmetricreturnscreatedresponse1747896106"
},
"response": {
"bodySize": 0,
Expand All @@ -94,8 +94,8 @@
"status": 204,
"statusText": "No Content"
},
"startedDateTime": "2024-11-28T15:31:19.829Z",
"time": 317
"startedDateTime": "2025-05-22T06:41:47.579Z",
"time": 308
}
],
"pages": [],
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/rum-metrics/CreateRumMetric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const params: v2.RumMetricsApiCreateRumMetricRequest = {
when: "match",
},
},
id: "rum.sessions.webui.count",
id: "examplerummetric",
type: "rum_metrics",
},
},
Expand Down
4 changes: 2 additions & 2 deletions features/v2/rum_metrics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Feature: Rum Metrics
@team:DataDog/rum-backend
Scenario: Create a rum-based metric returns "Created" response
Given new "CreateRumMetric" request
And body with value {"data": {"attributes": {"compute": {"aggregation_type": "distribution", "include_percentiles": true, "path": "@duration"}, "event_type": "session", "filter": {"query": "@service:web-ui"}, "group_by": [{"path": "@browser.name", "tag_name": "browser_name"}], "uniqueness": {"when": "match"}}, "id": "rum.sessions.webui.count", "type": "rum_metrics"}}
And body with value {"data": {"attributes": {"compute": {"aggregation_type": "distribution", "include_percentiles": true, "path": "@duration"}, "event_type": "session", "filter": {"query": "@service:web-ui"}, "group_by": [{"path": "@browser.name", "tag_name": "browser_name"}], "uniqueness": {"when": "match"}}, "id": "{{ unique_lower_alnum }}", "type": "rum_metrics"}}
When the request is sent
Then the response status is 201 Created
And the response "data.id" is equal to "rum.sessions.webui.count"
And the response "data.id" is equal to "{{ unique_lower_alnum }}"
And the response "data.type" is equal to "rum_metrics"
And the response "data.attributes.event_type" is equal to "session"
And the response "data.attributes.compute.aggregation_type" is equal to "distribution"
Expand Down