Skip to content

MWL no longer requires customers to configure specific time/space aggrs #2162

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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-04-14 16:33:13.933543",
"spec_repo_commit": "c0287407"
"regenerated": "2025-04-14 20:12:02.270255",
"spec_repo_commit": "71455c7c"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-04-14 16:33:13.949636",
"spec_repo_commit": "c0287407"
"regenerated": "2025-04-14 20:12:02.286393",
"spec_repo_commit": "71455c7c"
}
}
}
96 changes: 14 additions & 82 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19827,47 +19827,6 @@ components:
- time
- space
type: object
MetricCustomAggregations:
description: 'A list of queryable aggregation combinations for a count, rate,
or gauge metric.

By default, count and rate metrics require the (time: sum, space: sum) aggregation
and

Gauge metrics require the (time: avg, space: avg) aggregation.

Additional time & space combinations are also available:


- time: avg, space: avg

- time: avg, space: max

- time: avg, space: min

- time: avg, space: sum

- time: count, space: sum

- time: max, space: max

- time: min, space: min

- time: sum, space: avg

- time: sum, space: sum


Can only be applied to non_distribution metrics that have a `metric_type`
of `count`, `rate`, or `gauge`.'
example:
- space: sum
time: sum
- space: sum
time: count
items:
$ref: '#/components/schemas/MetricCustomAggregation'
type: array
MetricCustomSpaceAggregation:
description: A space aggregation for use in query.
enum:
Expand Down Expand Up @@ -20371,9 +20330,6 @@ components:
description: Object for a single metric tag configuration.
example:
attributes:
aggregations:
- space: avg
time: avg
created_at: '2020-03-25T09:48:37.463835Z'
metric_type: gauge
modified_at: '2020-04-25T09:48:37.463835Z'
Expand All @@ -20394,8 +20350,6 @@ components:
description: Object containing the definition of a metric tag configuration
attributes.
properties:
aggregations:
$ref: '#/components/schemas/MetricCustomAggregations'
created_at:
description: Timestamp when the tag configuration was created.
example: '2020-03-25T09:48:37.463835Z'
Expand Down Expand Up @@ -20438,8 +20392,6 @@ components:
description: Object containing the definition of a metric tag configuration
to be created.
properties:
aggregations:
$ref: '#/components/schemas/MetricCustomAggregations'
exclude_tags_mode:
description: 'When set to true, the configuration will exclude the configured
tags and include any other submitted tags.
Expand Down Expand Up @@ -20549,8 +20501,6 @@ components:
description: Object containing the definition of a metric tag configuration
to be updated.
properties:
aggregations:
$ref: '#/components/schemas/MetricCustomAggregations'
exclude_tags_mode:
description: 'When set to true, the configuration will exclude the configured
tags and include any other submitted tags.
Expand Down Expand Up @@ -45229,9 +45179,8 @@ paths:
- metric_tags_write
/api/v2/metrics/{metric_name}/active-configurations:
get:
description: List tags and aggregations that are actively queried on dashboards,
notebooks, monitors, the Metrics Explorer, and using the API for a given metric
name.
description: List tags that are actively queried on dashboards, notebooks, monitors,
the Metrics Explorer, and using the API for a given metric name.
operationId: ListActiveMetricConfigurations
parameters:
- $ref: '#/components/parameters/MetricName'
Expand Down Expand Up @@ -45277,7 +45226,7 @@ paths:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Too Many Requests
summary: List active tags and aggregations
summary: List active tags
tags:
- Metrics
x-permission:
Expand Down Expand Up @@ -45381,9 +45330,8 @@ paths:
- Metrics
/api/v2/metrics/{metric_name}/estimate:
get:
description: Returns the estimated cardinality for a metric with a given tag,
percentile and number of aggregations configuration using Metrics without
Limits™.
description: Returns the estimated cardinality for a metric with a given tag
and percentile configuration using Metrics without Limits™.
operationId: EstimateMetricsOutputSeries
parameters:
- $ref: '#/components/parameters/MetricName'
Expand All @@ -45405,16 +45353,6 @@ paths:
maximum: 2147483647
minimum: 49
type: integer
- description: The number of aggregations that a `count`, `rate`, or `gauge`
metric is configured to use. Max number of aggregation combos is 9.
example: 1
in: query
name: filter[num_aggregations]
required: false
schema:
format: int32
maximum: 9
type: integer
- description: A boolean, for distribution metrics only, to estimate cardinality
if the metric includes additional percentile aggregators.
example: true
Expand Down Expand Up @@ -45550,13 +45488,10 @@ paths:
- metrics_read
patch:
description: 'Update the tag configuration of a metric or percentile aggregations
of a distribution metric or custom aggregations
of a distribution metric. By setting `exclude_tags_mode`

of a count, rate, or gauge metric. By setting `exclude_tags_mode` to true
the behavior is changed

from an allow-list to a deny-list, and tags in the defined list will not be
queryable.
to true the behavior is changed from an allow-list to a deny-list, and tags
in the defined list will not be queryable.

Can only be used with application keys from users with the `Manage Tags for
Metrics` permission. This endpoint requires
Expand Down Expand Up @@ -45614,17 +45549,14 @@ paths:
description: 'Create and define a list of queryable tag keys for an existing
count/gauge/rate/distribution metric.

Optionally, include percentile aggregations on any distribution metric or
configure custom aggregations

on any count, rate, or gauge metric. By setting `exclude_tags_mode` to true
the behavior is changed
Optionally, include percentile aggregations on any distribution metric. By
setting `exclude_tags_mode`

from an allow-list to a deny-list, and tags in the defined list will not be
queryable.
to true the behavior is changed from an allow-list to a deny-list, and tags
in the defined list will not

Can only be used with application keys of users with the `Manage Tags for
Metrics` permission.'
be queryable. Can only be used with application keys of users with the `Manage
Tags for Metrics` permission.'
operationId: CreateTagConfiguration
parameters:
- $ref: '#/components/parameters/MetricName'
Expand Down
1 change: 0 additions & 1 deletion examples/v2/metrics/EstimateMetricsOutputSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const apiInstance = new v2.MetricsApi(configuration);
const params: v2.MetricsApiEstimateMetricsOutputSeriesRequest = {
metricName: "system.cpu.idle",
filterGroups: "app,host",
filterNumAggregations: 4,
};

apiInstance
Expand Down
4 changes: 2 additions & 2 deletions examples/v2/metrics/ListActiveMetricConfigurations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* List active tags and aggregations returns "Success" response
* List active tags returns "Success" response
*/

import { client, v2 } from "@datadog/datadog-api-client";
Expand All @@ -8,7 +8,7 @@ const configuration = client.createConfiguration();
const apiInstance = new v2.MetricsApi(configuration);

const params: v2.MetricsApiListActiveMetricConfigurationsRequest = {
metricName: "static_test_metric_donotdelete",
metricName: "metric_name",
};

apiInstance
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* List active tags and aggregations returns "Success" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.MetricsApi(configuration);

const params: v2.MetricsApiListActiveMetricConfigurationsRequest = {
metricName: "static_test_metric_donotdelete",
};

apiInstance
.listActiveMetricConfigurations(params)
.then((data: v2.MetricSuggestedTagsAndAggregationsResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
4 changes: 0 additions & 4 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4802,10 +4802,6 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
"type": "number",
"format": "int32",
},
"filterNumAggregations": {
"type": "number",
"format": "int32",
},
"filterPct": {
"type": "boolean",
"format": "",
Expand Down
25 changes: 16 additions & 9 deletions features/v2/metrics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -152,32 +152,40 @@ Feature: Metrics
Then the response status is 200 Success
And the response "data[0].type" is equal to "manage_tags"

@skip-validation @team:DataDog/metrics-experience
Scenario: List active tags and aggregations returns "Success" response
Given a valid "appKeyAuth" key in the system
And there is a valid "metric_static" in the system
And new "ListActiveMetricConfigurations" request
And request contains "metric_name" parameter with value "static_test_metric_donotdelete"
When the request is sent
Then the response status is 200 Success
And the response "data.type" is equal to "actively_queried_configurations"
And the response "data.id" is equal to "static_test_metric_donotdelete"

@generated @skip @team:DataDog/metrics-experience
Scenario: List active tags and aggregations returns "Bad Request" response
Scenario: List active tags returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
And new "ListActiveMetricConfigurations" request
And request contains "metric_name" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/metrics-experience
Scenario: List active tags and aggregations returns "Not Found" response
Scenario: List active tags returns "Not Found" response
Given a valid "appKeyAuth" key in the system
And new "ListActiveMetricConfigurations" request
And request contains "metric_name" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@skip-validation @team:DataDog/metrics-experience
Scenario: List active tags and aggregations returns "Success" response
@generated @skip @team:DataDog/metrics-experience
Scenario: List active tags returns "Success" response
Given a valid "appKeyAuth" key in the system
And there is a valid "metric_static" in the system
And new "ListActiveMetricConfigurations" request
And request contains "metric_name" parameter with value "static_test_metric_donotdelete"
And request contains "metric_name" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 Success
And the response "data.type" is equal to "actively_queried_configurations"
And the response "data.id" is equal to "static_test_metric_donotdelete"

@generated @skip @team:DataDog/metrics-experience
Scenario: List distinct metric volumes by metric name returns "Bad Request" response
Expand Down Expand Up @@ -370,7 +378,6 @@ Feature: Metrics
Given new "EstimateMetricsOutputSeries" request
And request contains "metric_name" parameter with value "system.cpu.idle"
And request contains "filter[groups]" parameter with value "app,host"
And request contains "filter[num_aggregations]" parameter with value 4
When the request is sent
Then the response status is 200 Success

Expand Down
30 changes: 7 additions & 23 deletions packages/datadog-api-client-v2/apis/MetricsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory {
metricName: string,
filterGroups?: string,
filterHoursAgo?: number,
filterNumAggregations?: number,
filterPct?: boolean,
filterTimespanH?: number,
_options?: Configuration
Expand Down Expand Up @@ -253,13 +252,6 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory {
""
);
}
if (filterNumAggregations !== undefined) {
requestContext.setQueryParam(
"filter[num_aggregations]",
ObjectSerializer.serialize(filterNumAggregations, "number", "int32"),
""
);
}
if (filterPct !== undefined) {
requestContext.setQueryParam(
"filter[pct]",
Expand Down Expand Up @@ -1755,11 +1747,6 @@ export interface MetricsApiEstimateMetricsOutputSeriesRequest {
* @type number
*/
filterHoursAgo?: number;
/**
* The number of aggregations that a `count`, `rate`, or `gauge` metric is configured to use. Max number of aggregation combos is 9.
* @type number
*/
filterNumAggregations?: number;
/**
* A boolean, for distribution metrics only, to estimate cardinality if the metric includes additional percentile aggregators.
* @type boolean
Expand Down Expand Up @@ -1964,10 +1951,9 @@ export class MetricsApi {

/**
* Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric.
* Optionally, include percentile aggregations on any distribution metric or configure custom aggregations
* on any count, rate, or gauge metric. By setting `exclude_tags_mode` to true the behavior is changed
* from an allow-list to a deny-list, and tags in the defined list will not be queryable.
* Can only be used with application keys of users with the `Manage Tags for Metrics` permission.
* Optionally, include percentile aggregations on any distribution metric. By setting `exclude_tags_mode`
* to true the behavior is changed from an allow-list to a deny-list, and tags in the defined list will not
* be queryable. Can only be used with application keys of users with the `Manage Tags for Metrics` permission.
* @param param The request object
*/
public createTagConfiguration(
Expand Down Expand Up @@ -2038,7 +2024,7 @@ export class MetricsApi {
}

/**
* Returns the estimated cardinality for a metric with a given tag, percentile and number of aggregations configuration using Metrics without Limits™.
* Returns the estimated cardinality for a metric with a given tag and percentile configuration using Metrics without Limits™.
* @param param The request object
*/
public estimateMetricsOutputSeries(
Expand All @@ -2050,7 +2036,6 @@ export class MetricsApi {
param.metricName,
param.filterGroups,
param.filterHoursAgo,
param.filterNumAggregations,
param.filterPct,
param.filterTimespanH,
options
Expand All @@ -2067,7 +2052,7 @@ export class MetricsApi {
}

/**
* List tags and aggregations that are actively queried on dashboards, notebooks, monitors, the Metrics Explorer, and using the API for a given metric name.
* List tags that are actively queried on dashboards, notebooks, monitors, the Metrics Explorer, and using the API for a given metric name.
* @param param The request object
*/
public listActiveMetricConfigurations(
Expand Down Expand Up @@ -2352,9 +2337,8 @@ export class MetricsApi {
}

/**
* Update the tag configuration of a metric or percentile aggregations of a distribution metric or custom aggregations
* of a count, rate, or gauge metric. By setting `exclude_tags_mode` to true the behavior is changed
* from an allow-list to a deny-list, and tags in the defined list will not be queryable.
* Update the tag configuration of a metric or percentile aggregations of a distribution metric. By setting `exclude_tags_mode`
* to true the behavior is changed from an allow-list to a deny-list, and tags in the defined list will not be queryable.
* Can only be used with application keys from users with the `Manage Tags for Metrics` permission. This endpoint requires
* a tag configuration to be created first.
* @param param The request object
Expand Down
Loading
Loading