Skip to content

Commit bc86867

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit e6216ca6 of spec repo (#648)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent dd29a0a commit bc86867

File tree

15 files changed

+676
-4
lines changed

15 files changed

+676
-4
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.2",
7-
"regenerated": "2022-05-13 13:23:03.694305",
8-
"spec_repo_commit": "a8ff8116"
7+
"regenerated": "2022-05-16 16:35:09.192156",
8+
"spec_repo_commit": "e6216ca6"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-05-13 13:23:03.707074",
13-
"spec_repo_commit": "a8ff8116"
12+
"regenerated": "2022-05-16 16:35:09.208631",
13+
"spec_repo_commit": "e6216ca6"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3987,6 +3987,63 @@ components:
39873987
type: string
39883988
x-enum-varnames:
39893989
- DISTINCT_METRIC_VOLUMES
3990+
MetricEstimate:
3991+
description: Object for a metric cardinality estimate.
3992+
properties:
3993+
attributes:
3994+
$ref: '#/components/schemas/MetricEstimateAttributes'
3995+
id:
3996+
$ref: '#/components/schemas/MetricName'
3997+
type:
3998+
$ref: '#/components/schemas/MetricEstimateResourceType'
3999+
type: object
4000+
MetricEstimateAttributes:
4001+
description: Object containing the definition of a metric estimate attribute.
4002+
properties:
4003+
estimate_type:
4004+
$ref: '#/components/schemas/MetricEstimateType'
4005+
estimated_at:
4006+
description: Timestamp when the cardinality estimate was requested.
4007+
example: '2022-04-27T09:48:37.463835Z'
4008+
format: date-time
4009+
type: string
4010+
estimated_output_series:
4011+
description: Estimated cardinality of the metric based on the queried configuration.
4012+
example: 50
4013+
format: int64
4014+
type: integer
4015+
type: object
4016+
MetricEstimateResourceType:
4017+
default: metric_cardinality_estimate
4018+
description: The metric estimate resource type.
4019+
enum:
4020+
- metric_cardinality_estimate
4021+
example: metric_cardinality_estimate
4022+
type: string
4023+
x-enum-varnames:
4024+
- METRIC_CARDINALITY_ESTIMATE
4025+
MetricEstimateResponse:
4026+
description: Response object that includes metric cardinality estimates.
4027+
properties:
4028+
data:
4029+
$ref: '#/components/schemas/MetricEstimate'
4030+
type: object
4031+
MetricEstimateType:
4032+
default: count_or_gauge
4033+
description: Estimate type based on the queried configuration. By default, `count_or_gauge`
4034+
is returned. `distribution` is returned for distribution metrics without percentiles
4035+
enabled. Lastly, `percentile` is returned if `filter[pct]=true` is queried
4036+
with a distribution metric.
4037+
enum:
4038+
- count_or_gauge
4039+
- distribution
4040+
- percentile
4041+
example: distribution
4042+
type: string
4043+
x-enum-varnames:
4044+
- COUNT_OR_GAUGE
4045+
- DISTRIBUTION
4046+
- PERCENTILE
39904047
MetricIngestedIndexedVolume:
39914048
description: Object for a single metric's ingested and indexed volume.
39924049
properties:
@@ -9533,6 +9590,106 @@ paths:
95339590
x-menu-order: 6
95349591
x-undo:
95359592
type: safe
9593+
/api/v2/metrics/{metric_name}/estimate:
9594+
get:
9595+
description: Returns a cardinality estimate for a metric with a given tag, percentile,
9596+
and number of aggregations configuration.
9597+
operationId: EstimateMetricsOutputSeries
9598+
parameters:
9599+
- $ref: '#/components/parameters/MetricName'
9600+
- description: Filtered tag groups that the metric is configured to query with.
9601+
example: app,host
9602+
in: query
9603+
name: filter[groups]
9604+
required: false
9605+
schema:
9606+
type: string
9607+
- description: The number of hours of look back (from now) to estimate cardinality
9608+
with.
9609+
example: 49
9610+
in: query
9611+
name: filter[hours_ago]
9612+
required: false
9613+
schema:
9614+
type: integer
9615+
- description: The number of aggregations that a `count`, `rate`, or `gauge`
9616+
metric is configured to use. Max number of aggregation combos is 9.
9617+
example: 1
9618+
in: query
9619+
name: filter[num_aggregations]
9620+
required: false
9621+
schema:
9622+
type: integer
9623+
- description: A boolean, for distribution metrics only, to estimate cardinality
9624+
if the metric includes additional percentile aggregators.
9625+
example: true
9626+
in: query
9627+
name: filter[pct]
9628+
required: false
9629+
schema:
9630+
type: boolean
9631+
- description: A window, in hours, from the look back to estimate cardinality
9632+
with.
9633+
example: 6
9634+
in: query
9635+
name: filter[timespan_h]
9636+
required: false
9637+
schema:
9638+
type: integer
9639+
responses:
9640+
'200':
9641+
content:
9642+
application/json:
9643+
schema:
9644+
$ref: '#/components/schemas/MetricEstimateResponse'
9645+
description: Success
9646+
'400':
9647+
content:
9648+
application/json:
9649+
schema:
9650+
$ref: '#/components/schemas/APIErrorResponse'
9651+
description: API error response.
9652+
'403':
9653+
content:
9654+
application/json:
9655+
schema:
9656+
$ref: '#/components/schemas/APIErrorResponse'
9657+
description: API error response.
9658+
'404':
9659+
content:
9660+
application/json:
9661+
schema:
9662+
$ref: '#/components/schemas/APIErrorResponse'
9663+
description: API error response.
9664+
'429':
9665+
content:
9666+
application/json:
9667+
schema:
9668+
$ref: '#/components/schemas/APIErrorResponse'
9669+
description: Too Many Requests
9670+
security:
9671+
- apiKeyAuth: []
9672+
appKeyAuth: []
9673+
- AuthZ: []
9674+
summary: Estimate Output Series - Public v2 API
9675+
tags:
9676+
- Metrics
9677+
x-dd-ownership:
9678+
notification_configuration:
9679+
manual_escalation_policy: '[Points Aggregation] Primary'
9680+
prod_high_urgency: '@pagerduty-Points-Aggregation @slack-points-aggr-ops'
9681+
prod_low_urgency: '@slack-points-aggr-ops'
9682+
slack_support_channel: '#points-aggregation'
9683+
staging_high_urgency: '@slack-points-aggr-stg-ops'
9684+
staging_low_urgency: '@slack-points-aggr-stg-ops'
9685+
team: points-aggregation
9686+
team_escalation: '[Points Aggregation] Primary'
9687+
x-menu-order: 10
9688+
x-permission:
9689+
operator: OPEN
9690+
permissions: []
9691+
x-undo:
9692+
type: safe
95369693
/api/v2/metrics/{metric_name}/tags:
95379694
delete:
95389695
description: 'Deletes a metric''s tag configuration. Can only be used with application
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-05-16T16:31:27.866Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"log": {
3+
"_recordingName": "Metrics/Estimate Output Series - Public v2 API returns \"Success\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.4"
8+
},
9+
"entries": [
10+
{
11+
"_id": "6b4ad177b207bd70887f5dce5b0641f7",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 0,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
}
23+
],
24+
"headersSize": 601,
25+
"httpVersion": "HTTP/1.1",
26+
"method": "GET",
27+
"queryString": [
28+
{
29+
"name": "filter",
30+
"value": {
31+
"groups": "app,host",
32+
"num_aggregations": "4"
33+
}
34+
}
35+
],
36+
"url": "https://api.datadoghq.com/api/v2/metrics/system.cpu.idle/estimate?filter%5Bgroups%5D=app%2Chost&filter%5Bnum_aggregations%5D=4"
37+
},
38+
"response": {
39+
"bodySize": 193,
40+
"content": {
41+
"mimeType": "application/json",
42+
"size": 193,
43+
"text": "{\"data\":{\"attributes\":{\"estimated_output_series\":68,\"estimate_type\":\"count_or_gauge\",\"estimated_at\":\"2022-05-14T09:31:28.108179Z\"},\"type\":\"metric_cardinality_estimate\",\"id\":\"system.cpu.idle\"}}\n"
44+
},
45+
"cookies": [],
46+
"headers": [
47+
{
48+
"name": "content-type",
49+
"value": "application/json"
50+
}
51+
],
52+
"headersSize": 623,
53+
"httpVersion": "HTTP/1.1",
54+
"redirectURL": "",
55+
"status": 200,
56+
"statusText": "OK"
57+
},
58+
"startedDateTime": "2022-05-16T16:31:27.884Z",
59+
"time": 467
60+
}
61+
],
62+
"pages": [],
63+
"version": "1.2"
64+
}
65+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Estimate Output Series - Public v2 API returns "Success" response
3+
*/
4+
5+
import { v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = v2.createConfiguration();
8+
const apiInstance = new v2.MetricsApi(configuration);
9+
10+
const params: v2.MetricsApiEstimateMetricsOutputSeriesRequest = {
11+
metricName: "system.cpu.idle",
12+
filterGroups: "app,host",
13+
filterNumAggregations: 4,
14+
};
15+
16+
apiInstance
17+
.estimateMetricsOutputSeries(params)
18+
.then((data: v2.MetricEstimateResponse) => {
19+
console.log(
20+
"API called successfully. Returned data: " + JSON.stringify(data)
21+
);
22+
})
23+
.catch((error: any) => console.error(error));

features/v2/metrics.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,22 @@ Feature: Metrics
8282
When the request is sent
8383
Then the response status is 404 Not found
8484

85+
@generated @skip @team:DataDog/points-aggregation
86+
Scenario: Estimate Output Series - Public v2 API returns "API error response." response
87+
Given new "EstimateMetricsOutputSeries" request
88+
And request contains "metric_name" parameter from "REPLACE.ME"
89+
When the request is sent
90+
Then the response status is 404 API error response.
91+
92+
@replay-only @team:DataDog/points-aggregation
93+
Scenario: Estimate Output Series - Public v2 API returns "Success" response
94+
Given new "EstimateMetricsOutputSeries" request
95+
And request contains "metric_name" parameter with value "system.cpu.idle"
96+
And request contains "filter[groups]" parameter with value "app,host"
97+
And request contains "filter[num_aggregations]" parameter with value 4
98+
When the request is sent
99+
Then the response status is 200 Success
100+
85101
@generated @skip @team:DataDog/points-aggregation
86102
Scenario: List distinct metric volumes by metric name returns "Bad Request" response
87103
Given new "ListVolumesByMetricName" request

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,12 @@
366366
"type": "safe"
367367
}
368368
},
369+
"EstimateMetricsOutputSeries": {
370+
"tag": "Metrics",
371+
"undo": {
372+
"type": "safe"
373+
}
374+
},
369375
"DeleteTagConfiguration": {
370376
"tag": "Metrics",
371377
"undo": {

0 commit comments

Comments
 (0)