Skip to content

Commit 065e443

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[RUM] Use a randomized id for metrics creation scenarios. (#2869)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent fce8d6d commit 065e443

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
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": "2025-05-23 12:48:19.641798",
8-
"spec_repo_commit": "11a9dcb4"
7+
"regenerated": "2025-05-23 14:41:13.594077",
8+
"spec_repo_commit": "a4ecd4cf"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-23 12:48:19.657459",
13-
"spec_repo_commit": "11a9dcb4"
12+
"regenerated": "2025-05-23 14:41:13.611442",
13+
"spec_repo_commit": "a4ecd4cf"
1414
}
1515
}
1616
}

examples/v2/rum-metrics/CreateRumMetric.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static void main(String[] args) {
4242
.tagName("browser_name")))
4343
.uniqueness(
4444
new RumMetricUniqueness().when(RumMetricUniquenessWhen.WHEN_MATCH)))
45-
.id("rum.sessions.webui.count")
45+
.id("examplerummetric")
4646
.type(RumMetricType.RUM_METRICS));
4747

4848
try {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-11-28T15:31:19.388Z
1+
2025-05-22T06:41:46.880Z

src/test/resources/cassettes/features/v2/Create_a_rum_based_metric_returns_Created_response.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"httpRequest": {
44
"body": {
55
"type": "JSON",
6-
"json": "{\"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\"}}"
6+
"json": "{\"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\"}}"
77
},
88
"headers": {},
99
"method": "POST",
@@ -12,7 +12,7 @@
1212
"secure": true
1313
},
1414
"httpResponse": {
15-
"body": "{\"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\"}}}}",
15+
"body": "{\"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\"}}}}",
1616
"headers": {
1717
"Content-Type": [
1818
"application/vnd.api+json"
@@ -27,13 +27,13 @@
2727
"timeToLive": {
2828
"unlimited": true
2929
},
30-
"id": "a60dcd3f-6b42-61be-976b-55b839c23015"
30+
"id": "5e0d2db1-5a24-b26d-e971-a05af71e7ec8"
3131
},
3232
{
3333
"httpRequest": {
3434
"headers": {},
3535
"method": "DELETE",
36-
"path": "/api/v2/rum/config/metrics/rum.sessions.webui.count",
36+
"path": "/api/v2/rum/config/metrics/testcreatearumbasedmetricreturnscreatedresponse1747896106",
3737
"keepAlive": false,
3838
"secure": true
3939
},
@@ -48,6 +48,6 @@
4848
"timeToLive": {
4949
"unlimited": true
5050
},
51-
"id": "f43cd3bd-54ea-b636-71dc-c9e06bea290c"
51+
"id": "4afe641a-e95c-2475-bc3a-29853567e435"
5252
}
5353
]

src/test/resources/com/datadog/api/client/v2/api/rum_metrics.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Feature: Rum Metrics
2727
@team:DataDog/rum-backend
2828
Scenario: Create a rum-based metric returns "Created" response
2929
Given new "CreateRumMetric" request
30-
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"}}
30+
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"}}
3131
When the request is sent
3232
Then the response status is 201 Created
33-
And the response "data.id" is equal to "rum.sessions.webui.count"
33+
And the response "data.id" is equal to "{{ unique_lower_alnum }}"
3434
And the response "data.type" is equal to "rum_metrics"
3535
And the response "data.attributes.event_type" is equal to "session"
3636
And the response "data.attributes.compute.aggregation_type" is equal to "distribution"

0 commit comments

Comments
 (0)