Skip to content

Commit 6f46d76

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update metrics all-tags endpoint documentation (#3281)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 221e3c4 commit 6f46d76

6 files changed

Lines changed: 213 additions & 14 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 82 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32619,7 +32619,7 @@ components:
3261932619
x-enum-varnames:
3262032620
- ACTIVELY_QUERIED_CONFIGURATIONS
3262132621
MetricAllTags:
32622-
description: Object for a single metric's indexed tags.
32622+
description: Object for a single metric's indexed and ingested tags.
3262332623
properties:
3262432624
attributes:
3262532625
$ref: '#/components/schemas/MetricAllTagsAttributes'
@@ -32629,21 +32629,33 @@ components:
3262932629
$ref: '#/components/schemas/MetricType'
3263032630
type: object
3263132631
MetricAllTagsAttributes:
32632-
description: Object containing the definition of a metric's tags.
32632+
description: Object containing the definition of a metric's indexed and ingested
32633+
tags.
3263332634
properties:
32635+
ingested_tags:
32636+
description: List of ingested tags that are not indexed.
32637+
example:
32638+
- env:prod
32639+
- service:web
32640+
- version:1.0
32641+
items:
32642+
description: Ingested tags for the metric.
32643+
type: string
32644+
type: array
3263432645
tags:
32635-
description: List of indexed tag value pairs.
32646+
description: List of indexed tags.
3263632647
example:
3263732648
- sport:golf
3263832649
- sport:football
3263932650
- animal:dog
3264032651
items:
32641-
description: Tag key-value pairs.
32652+
description: Indexed tags for the metric.
3264232653
type: string
3264332654
type: array
3264432655
type: object
3264532656
MetricAllTagsResponse:
32646-
description: Response object that includes a single metric's indexed tags.
32657+
description: Response object that includes a single metric's indexed and ingested
32658+
tags.
3264732659
properties:
3264832660
data:
3264932661
$ref: '#/components/schemas/MetricAllTags'
@@ -77321,11 +77333,74 @@ paths:
7732177333
- metrics_read
7732277334
/api/v2/metrics/{metric_name}/all-tags:
7732377335
get:
77324-
description: View indexed tag key-value pairs for a given metric name over the
77325-
previous hour.
77336+
description: 'View indexed and ingested tags for a given metric name.
77337+
77338+
Results are filtered by the `window[seconds]` parameter, which defaults to
77339+
14400 (4 hours).'
7732677340
operationId: ListTagsByMetricName
7732777341
parameters:
7732877342
- $ref: '#/components/parameters/MetricName'
77343+
- description: 'The number of seconds of look back (from now) to query for tag
77344+
data.
77345+
77346+
Default value is 14400 (4 hours), minimum value is 14400 (4 hours).'
77347+
example: 14400
77348+
in: query
77349+
name: window[seconds]
77350+
required: false
77351+
schema:
77352+
format: int64
77353+
type: integer
77354+
- description: 'Filter results to tags from data points that have the specified
77355+
tags.
77356+
77357+
For example, `filter[tags]=env:staging,host:123` returns tags only from
77358+
data points with both `env:staging` and `host:123`.'
77359+
example: env:staging,host:123
77360+
in: query
77361+
name: filter[tags]
77362+
required: false
77363+
schema:
77364+
type: string
77365+
- description: 'Filter returned tags to those matching a substring.
77366+
77367+
For example, `filter[match]=env` returns tags like `env:prod`, `environment:staging`,
77368+
etc.'
77369+
example: env
77370+
in: query
77371+
name: filter[match]
77372+
required: false
77373+
schema:
77374+
type: string
77375+
- description: 'Whether to include tag values in the response.
77376+
77377+
Defaults to true.'
77378+
example: true
77379+
in: query
77380+
name: filter[include_tag_values]
77381+
required: false
77382+
schema:
77383+
type: boolean
77384+
- description: 'Whether to allow partial results.
77385+
77386+
Defaults to false.'
77387+
example: false
77388+
in: query
77389+
name: filter[allow_partial]
77390+
required: false
77391+
schema:
77392+
type: boolean
77393+
- description: Maximum number of results to return.
77394+
example: 1000
77395+
in: query
77396+
name: page[limit]
77397+
required: false
77398+
schema:
77399+
default: 1000000
77400+
format: int32
77401+
maximum: 1000000
77402+
minimum: 1
77403+
type: integer
7732977404
responses:
7733077405
'200':
7733177406
content:

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7223,6 +7223,30 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
72237223
type: "string",
72247224
format: "",
72257225
},
7226+
windowSeconds: {
7227+
type: "number",
7228+
format: "int64",
7229+
},
7230+
filterTags: {
7231+
type: "string",
7232+
format: "",
7233+
},
7234+
filterMatch: {
7235+
type: "string",
7236+
format: "",
7237+
},
7238+
filterIncludeTagValues: {
7239+
type: "boolean",
7240+
format: "",
7241+
},
7242+
filterAllowPartial: {
7243+
type: "boolean",
7244+
format: "",
7245+
},
7246+
pageLimit: {
7247+
type: "number",
7248+
format: "int32",
7249+
},
72267250
operationResponseType: "MetricAllTagsResponse",
72277251
},
72287252
"MetricsApi.V2.ListMetricAssets": {

services/metrics/src/v2/MetricsApi.ts

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,12 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory {
661661

662662
public async listTagsByMetricName(
663663
metricName: string,
664+
windowSeconds?: number,
665+
filterTags?: string,
666+
filterMatch?: string,
667+
filterIncludeTagValues?: boolean,
668+
filterAllowPartial?: boolean,
669+
pageLimit?: number,
664670
_options?: Configuration,
665671
): Promise<RequestContext> {
666672
const _config = _options || this.configuration;
@@ -694,6 +700,50 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory {
694700
requestContext.setHeaderParam("User-Agent", this.userAgent);
695701
}
696702

703+
// Query Params
704+
if (windowSeconds !== undefined) {
705+
requestContext.setQueryParam(
706+
"window[seconds]",
707+
serialize(windowSeconds, TypingInfo, "number", "int64"),
708+
"",
709+
);
710+
}
711+
if (filterTags !== undefined) {
712+
requestContext.setQueryParam(
713+
"filter[tags]",
714+
serialize(filterTags, TypingInfo, "string", ""),
715+
"",
716+
);
717+
}
718+
if (filterMatch !== undefined) {
719+
requestContext.setQueryParam(
720+
"filter[match]",
721+
serialize(filterMatch, TypingInfo, "string", ""),
722+
"",
723+
);
724+
}
725+
if (filterIncludeTagValues !== undefined) {
726+
requestContext.setQueryParam(
727+
"filter[include_tag_values]",
728+
serialize(filterIncludeTagValues, TypingInfo, "boolean", ""),
729+
"",
730+
);
731+
}
732+
if (filterAllowPartial !== undefined) {
733+
requestContext.setQueryParam(
734+
"filter[allow_partial]",
735+
serialize(filterAllowPartial, TypingInfo, "boolean", ""),
736+
"",
737+
);
738+
}
739+
if (pageLimit !== undefined) {
740+
requestContext.setQueryParam(
741+
"page[limit]",
742+
serialize(pageLimit, TypingInfo, "number", "int32"),
743+
"",
744+
);
745+
}
746+
697747
// Apply auth methods
698748
applySecurityAuthentication(_config, requestContext, [
699749
"apiKeyAuth",
@@ -2103,6 +2153,41 @@ export interface MetricsApiListTagsByMetricNameRequest {
21032153
* @type string
21042154
*/
21052155
metricName: string;
2156+
/**
2157+
* The number of seconds of look back (from now) to query for tag data.
2158+
* Default value is 14400 (4 hours), minimum value is 14400 (4 hours).
2159+
* @type number
2160+
*/
2161+
windowSeconds?: number;
2162+
/**
2163+
* Filter results to tags from data points that have the specified tags.
2164+
* For example, `filter[tags]=env:staging,host:123` returns tags only from data points with both `env:staging` and `host:123`.
2165+
* @type string
2166+
*/
2167+
filterTags?: string;
2168+
/**
2169+
* Filter returned tags to those matching a substring.
2170+
* For example, `filter[match]=env` returns tags like `env:prod`, `environment:staging`, etc.
2171+
* @type string
2172+
*/
2173+
filterMatch?: string;
2174+
/**
2175+
* Whether to include tag values in the response.
2176+
* Defaults to true.
2177+
* @type boolean
2178+
*/
2179+
filterIncludeTagValues?: boolean;
2180+
/**
2181+
* Whether to allow partial results.
2182+
* Defaults to false.
2183+
* @type boolean
2184+
*/
2185+
filterAllowPartial?: boolean;
2186+
/**
2187+
* Maximum number of results to return.
2188+
* @type number
2189+
*/
2190+
pageLimit?: number;
21062191
}
21072192

21082193
export interface MetricsApiListVolumesByMetricNameRequest {
@@ -2488,7 +2573,8 @@ export class MetricsApi {
24882573
}
24892574

24902575
/**
2491-
* View indexed tag key-value pairs for a given metric name over the previous hour.
2576+
* View indexed and ingested tags for a given metric name.
2577+
* Results are filtered by the `window[seconds]` parameter, which defaults to 14400 (4 hours).
24922578
* @param param The request object
24932579
*/
24942580
public listTagsByMetricName(
@@ -2497,6 +2583,12 @@ export class MetricsApi {
24972583
): Promise<MetricAllTagsResponse> {
24982584
const requestContextPromise = this.requestFactory.listTagsByMetricName(
24992585
param.metricName,
2586+
param.windowSeconds,
2587+
param.filterTags,
2588+
param.filterMatch,
2589+
param.filterIncludeTagValues,
2590+
param.filterAllowPartial,
2591+
param.pageLimit,
25002592
options,
25012593
);
25022594
return requestContextPromise.then((requestContext) => {

services/metrics/src/v2/models/MetricAllTags.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { MetricAllTagsAttributes } from "./MetricAllTagsAttributes";
44
import { MetricType } from "./MetricType";
55

66
/**
7-
* Object for a single metric's indexed tags.
7+
* Object for a single metric's indexed and ingested tags.
88
*/
99
export class MetricAllTags {
1010
/**
11-
* Object containing the definition of a metric's tags.
11+
* Object containing the definition of a metric's indexed and ingested tags.
1212
*/
1313
"attributes"?: MetricAllTagsAttributes;
1414
/**

services/metrics/src/v2/models/MetricAllTagsAttributes.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import { AttributeTypeMap } from "@datadog/datadog-api-client";
22

33
/**
4-
* Object containing the definition of a metric's tags.
4+
* Object containing the definition of a metric's indexed and ingested tags.
55
*/
66
export class MetricAllTagsAttributes {
77
/**
8-
* List of indexed tag value pairs.
8+
* List of ingested tags that are not indexed.
9+
*/
10+
"ingestedTags"?: Array<string>;
11+
/**
12+
* List of indexed tags.
913
*/
1014
"tags"?: Array<string>;
1115
/**
@@ -23,6 +27,10 @@ export class MetricAllTagsAttributes {
2327
* @ignore
2428
*/
2529
static readonly attributeTypeMap: AttributeTypeMap = {
30+
ingestedTags: {
31+
baseName: "ingested_tags",
32+
type: "Array<string>",
33+
},
2634
tags: {
2735
baseName: "tags",
2836
type: "Array<string>",

services/metrics/src/v2/models/MetricAllTagsResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client";
33
import { MetricAllTags } from "./MetricAllTags";
44

55
/**
6-
* Response object that includes a single metric's indexed tags.
6+
* Response object that includes a single metric's indexed and ingested tags.
77
*/
88
export class MetricAllTagsResponse {
99
/**
10-
* Object for a single metric's indexed tags.
10+
* Object for a single metric's indexed and ingested tags.
1111
*/
1212
"data"?: MetricAllTags;
1313
/**

0 commit comments

Comments
 (0)