Skip to content

Update v2 metrics list endpoint filter by metric type to use metric type category #1833

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": "2024-09-26 19:34:42.677306",
"spec_repo_commit": "83debf9e"
"regenerated": "2024-09-30 13:57:00.510111",
"spec_repo_commit": "eb66b1cf"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-26 19:34:42.692826",
"spec_repo_commit": "83debf9e"
"regenerated": "2024-09-30 13:57:00.525119",
"spec_repo_commit": "eb66b1cf"
}
}
}
17 changes: 14 additions & 3 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13939,8 +13939,8 @@ components:
- time: sum, space: sum


Can only be applied to metrics that have a `metric_type` of `count`, `rate`,
or `gauge`.'
Can only be applied to non_distribution metrics that have a `metric_type`
of `count`, `rate`, or `gauge`.'
example:
- space: sum
time: sum
Expand Down Expand Up @@ -14548,6 +14548,17 @@ components:
required:
- data
type: object
MetricTagConfigurationMetricTypeCategory:
default: distribution
description: The metric's type category.
enum:
- non_distribution
- distribution
example: distribution
type: string
x-enum-varnames:
- NON_DISTRIBUTION
- DISTRIBUTION
MetricTagConfigurationMetricTypes:
default: gauge
description: The metric's type.
Expand Down Expand Up @@ -32405,7 +32416,7 @@ paths:
name: filter[metric_type]
required: false
schema:
$ref: '#/components/schemas/MetricTagConfigurationMetricTypes'
$ref: '#/components/schemas/MetricTagConfigurationMetricTypeCategory'
- description: 'Filter distributions with additional percentile

aggregations enabled or disabled.'
Expand Down
2 changes: 1 addition & 1 deletion features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4207,7 +4207,7 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
"format": "",
},
"filterMetricType": {
"type": "MetricTagConfigurationMetricTypes",
"type": "MetricTagConfigurationMetricTypeCategory",
"format": "",
},
"filterIncludePercentiles": {
Expand Down
10 changes: 5 additions & 5 deletions packages/datadog-api-client-v2/apis/MetricsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { MetricPayload } from "../models/MetricPayload";
import { MetricsAndMetricTagConfigurationsResponse } from "../models/MetricsAndMetricTagConfigurationsResponse";
import { MetricSuggestedTagsAndAggregationsResponse } from "../models/MetricSuggestedTagsAndAggregationsResponse";
import { MetricTagConfigurationCreateRequest } from "../models/MetricTagConfigurationCreateRequest";
import { MetricTagConfigurationMetricTypes } from "../models/MetricTagConfigurationMetricTypes";
import { MetricTagConfigurationMetricTypeCategory } from "../models/MetricTagConfigurationMetricTypeCategory";
import { MetricTagConfigurationResponse } from "../models/MetricTagConfigurationResponse";
import { MetricTagConfigurationUpdateRequest } from "../models/MetricTagConfigurationUpdateRequest";
import { MetricVolumesResponse } from "../models/MetricVolumesResponse";
Expand Down Expand Up @@ -392,7 +392,7 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory {
public async listTagConfigurations(
filterConfigured?: boolean,
filterTagsConfigured?: string,
filterMetricType?: MetricTagConfigurationMetricTypes,
filterMetricType?: MetricTagConfigurationMetricTypeCategory,
filterIncludePercentiles?: boolean,
filterQueried?: boolean,
filterTags?: string,
Expand Down Expand Up @@ -429,7 +429,7 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory {
"filter[metric_type]",
ObjectSerializer.serialize(
filterMetricType,
"MetricTagConfigurationMetricTypes",
"MetricTagConfigurationMetricTypeCategory",
""
)
);
Expand Down Expand Up @@ -1787,9 +1787,9 @@ export interface MetricsApiListTagConfigurationsRequest {
filterTagsConfigured?: string;
/**
* Filter metrics by metric type.
* @type MetricTagConfigurationMetricTypes
* @type MetricTagConfigurationMetricTypeCategory
*/
filterMetricType?: MetricTagConfigurationMetricTypes;
filterMetricType?: MetricTagConfigurationMetricTypeCategory;
/**
* Filter distributions with additional percentile
* aggregations enabled or disabled.
Expand Down
1 change: 1 addition & 0 deletions packages/datadog-api-client-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,7 @@ export { MetricTagConfigurationAttributes } from "./models/MetricTagConfiguratio
export { MetricTagConfigurationCreateAttributes } from "./models/MetricTagConfigurationCreateAttributes";
export { MetricTagConfigurationCreateData } from "./models/MetricTagConfigurationCreateData";
export { MetricTagConfigurationCreateRequest } from "./models/MetricTagConfigurationCreateRequest";
export { MetricTagConfigurationMetricTypeCategory } from "./models/MetricTagConfigurationMetricTypeCategory";
export { MetricTagConfigurationMetricTypes } from "./models/MetricTagConfigurationMetricTypes";
export { MetricTagConfigurationResponse } from "./models/MetricTagConfigurationResponse";
export { MetricTagConfigurationType } from "./models/MetricTagConfigurationType";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class MetricTagConfigurationAttributes {
* - time: sum, space: avg
* - time: sum, space: sum
*
* Can only be applied to metrics that have a `metric_type` of `count`, `rate`, or `gauge`.
* Can only be applied to non_distribution metrics that have a `metric_type` of `count`, `rate`, or `gauge`.
*/
"aggregations"?: Array<MetricCustomAggregation>;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class MetricTagConfigurationCreateAttributes {
* - time: sum, space: avg
* - time: sum, space: sum
*
* Can only be applied to metrics that have a `metric_type` of `count`, `rate`, or `gauge`.
* Can only be applied to non_distribution metrics that have a `metric_type` of `count`, `rate`, or `gauge`.
*/
"aggregations"?: Array<MetricCustomAggregation>;
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/

import { UnparsedObject } from "../../datadog-api-client-common/util";

/**
* The metric's type category.
*/

export type MetricTagConfigurationMetricTypeCategory =
| typeof NON_DISTRIBUTION
| typeof DISTRIBUTION
| UnparsedObject;
export const NON_DISTRIBUTION = "non_distribution";
export const DISTRIBUTION = "distribution";
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class MetricTagConfigurationUpdateAttributes {
* - time: sum, space: avg
* - time: sum, space: sum
*
* Can only be applied to metrics that have a `metric_type` of `count`, `rate`, or `gauge`.
* Can only be applied to non_distribution metrics that have a `metric_type` of `count`, `rate`, or `gauge`.
*/
"aggregations"?: Array<MetricCustomAggregation>;
/**
Expand Down
4 changes: 4 additions & 0 deletions packages/datadog-api-client-v2/models/ObjectSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1549,6 +1549,10 @@ const enumsMap: { [key: string]: any[] } = {
MetricMonitorType: ["monitors"],
MetricNotebookType: ["notebooks"],
MetricSLOType: ["slos"],
MetricTagConfigurationMetricTypeCategory: [
"non_distribution",
"distribution",
],
MetricTagConfigurationMetricTypes: ["gauge", "count", "rate", "distribution"],
MetricTagConfigurationType: ["manage_tags"],
MetricType: ["metrics"],
Expand Down
Loading