Skip to content

Commit 4bbc1ea

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[RUM] Use a randomized id for metrics creation scenarios. (#2576)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent c751c5a commit 4bbc1ea

File tree

5 files changed

+11
-11
lines changed

5 files changed

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

examples/v2/rum-metrics/CreateRumMetric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
when=RumMetricUniquenessWhen.WHEN_MATCH,
3939
),
4040
),
41-
id="rum.sessions.webui.count",
41+
id="examplerummetric",
4242
type=RumMetricType.RUM_METRICS,
4343
),
4444
)
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

tests/v2/cassettes/test_scenarios/test_create_a_rumbased_metric_returns_created_response.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"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"}}'
3+
body: '{"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"}}'
44
headers:
55
accept:
66
- application/json
@@ -10,7 +10,7 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v2/rum/config/metrics
1111
response:
1212
body:
13-
string: '{"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"}}}}'
13+
string: '{"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"}}}}'
1414
headers:
1515
content-type:
1616
- application/vnd.api+json
@@ -23,7 +23,7 @@ interactions:
2323
accept:
2424
- '*/*'
2525
method: DELETE
26-
uri: https://api.datadoghq.com/api/v2/rum/config/metrics/rum.sessions.webui.count
26+
uri: https://api.datadoghq.com/api/v2/rum/config/metrics/testcreatearumbasedmetricreturnscreatedresponse1747896106
2727
response:
2828
body:
2929
string: ''

tests/v2/features/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)