Skip to content

Commit 08bc435

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update metrics all-tags endpoint documentation (#3388)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 7f467cc commit 08bc435

File tree

5 files changed

+291
-24
lines changed

5 files changed

+291
-24
lines changed

.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:

src/main/java/com/datadog/api/client/v2/api/MetricsApi.java

Lines changed: 163 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,89 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
19871987
new GenericType<MetricsAndMetricTagConfigurationsResponse>() {});
19881988
}
19891989

1990+
/** Manage optional parameters to listTagsByMetricName. */
1991+
public static class ListTagsByMetricNameOptionalParameters {
1992+
private Long windowSeconds;
1993+
private String filterTags;
1994+
private String filterMatch;
1995+
private Boolean filterIncludeTagValues;
1996+
private Boolean filterAllowPartial;
1997+
private Integer pageLimit;
1998+
1999+
/**
2000+
* Set windowSeconds.
2001+
*
2002+
* @param windowSeconds The number of seconds of look back (from now) to query for tag data.
2003+
* Default value is 14400 (4 hours), minimum value is 14400 (4 hours). (optional)
2004+
* @return ListTagsByMetricNameOptionalParameters
2005+
*/
2006+
public ListTagsByMetricNameOptionalParameters windowSeconds(Long windowSeconds) {
2007+
this.windowSeconds = windowSeconds;
2008+
return this;
2009+
}
2010+
2011+
/**
2012+
* Set filterTags.
2013+
*
2014+
* @param filterTags Filter results to tags from data points that have the specified tags. For
2015+
* example, <code>filter[tags]=env:staging,host:123</code> returns tags only from data
2016+
* points with both <code>env:staging</code> and <code>host:123</code>. (optional)
2017+
* @return ListTagsByMetricNameOptionalParameters
2018+
*/
2019+
public ListTagsByMetricNameOptionalParameters filterTags(String filterTags) {
2020+
this.filterTags = filterTags;
2021+
return this;
2022+
}
2023+
2024+
/**
2025+
* Set filterMatch.
2026+
*
2027+
* @param filterMatch Filter returned tags to those matching a substring. For example, <code>
2028+
* filter[match]=env</code> returns tags like <code>env:prod</code>, <code>
2029+
* environment:staging</code>, etc. (optional)
2030+
* @return ListTagsByMetricNameOptionalParameters
2031+
*/
2032+
public ListTagsByMetricNameOptionalParameters filterMatch(String filterMatch) {
2033+
this.filterMatch = filterMatch;
2034+
return this;
2035+
}
2036+
2037+
/**
2038+
* Set filterIncludeTagValues.
2039+
*
2040+
* @param filterIncludeTagValues Whether to include tag values in the response. Defaults to
2041+
* true. (optional)
2042+
* @return ListTagsByMetricNameOptionalParameters
2043+
*/
2044+
public ListTagsByMetricNameOptionalParameters filterIncludeTagValues(
2045+
Boolean filterIncludeTagValues) {
2046+
this.filterIncludeTagValues = filterIncludeTagValues;
2047+
return this;
2048+
}
2049+
2050+
/**
2051+
* Set filterAllowPartial.
2052+
*
2053+
* @param filterAllowPartial Whether to allow partial results. Defaults to false. (optional)
2054+
* @return ListTagsByMetricNameOptionalParameters
2055+
*/
2056+
public ListTagsByMetricNameOptionalParameters filterAllowPartial(Boolean filterAllowPartial) {
2057+
this.filterAllowPartial = filterAllowPartial;
2058+
return this;
2059+
}
2060+
2061+
/**
2062+
* Set pageLimit.
2063+
*
2064+
* @param pageLimit Maximum number of results to return. (optional, default to 1000000)
2065+
* @return ListTagsByMetricNameOptionalParameters
2066+
*/
2067+
public ListTagsByMetricNameOptionalParameters pageLimit(Integer pageLimit) {
2068+
this.pageLimit = pageLimit;
2069+
return this;
2070+
}
2071+
}
2072+
19902073
/**
19912074
* List tags by metric name.
19922075
*
@@ -1997,7 +2080,9 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
19972080
* @throws ApiException if fails to make API call
19982081
*/
19992082
public MetricAllTagsResponse listTagsByMetricName(String metricName) throws ApiException {
2000-
return listTagsByMetricNameWithHttpInfo(metricName).getData();
2083+
return listTagsByMetricNameWithHttpInfo(
2084+
metricName, new ListTagsByMetricNameOptionalParameters())
2085+
.getData();
20012086
}
20022087

20032088
/**
@@ -2009,17 +2094,53 @@ public MetricAllTagsResponse listTagsByMetricName(String metricName) throws ApiE
20092094
* @return CompletableFuture&lt;MetricAllTagsResponse&gt;
20102095
*/
20112096
public CompletableFuture<MetricAllTagsResponse> listTagsByMetricNameAsync(String metricName) {
2012-
return listTagsByMetricNameWithHttpInfoAsync(metricName)
2097+
return listTagsByMetricNameWithHttpInfoAsync(
2098+
metricName, new ListTagsByMetricNameOptionalParameters())
20132099
.thenApply(
20142100
response -> {
20152101
return response.getData();
20162102
});
20172103
}
20182104

20192105
/**
2020-
* View indexed tag key-value pairs for a given metric name over the previous hour.
2106+
* List tags by metric name.
2107+
*
2108+
* <p>See {@link #listTagsByMetricNameWithHttpInfo}.
20212109
*
20222110
* @param metricName The name of the metric. (required)
2111+
* @param parameters Optional parameters for the request.
2112+
* @return MetricAllTagsResponse
2113+
* @throws ApiException if fails to make API call
2114+
*/
2115+
public MetricAllTagsResponse listTagsByMetricName(
2116+
String metricName, ListTagsByMetricNameOptionalParameters parameters) throws ApiException {
2117+
return listTagsByMetricNameWithHttpInfo(metricName, parameters).getData();
2118+
}
2119+
2120+
/**
2121+
* List tags by metric name.
2122+
*
2123+
* <p>See {@link #listTagsByMetricNameWithHttpInfoAsync}.
2124+
*
2125+
* @param metricName The name of the metric. (required)
2126+
* @param parameters Optional parameters for the request.
2127+
* @return CompletableFuture&lt;MetricAllTagsResponse&gt;
2128+
*/
2129+
public CompletableFuture<MetricAllTagsResponse> listTagsByMetricNameAsync(
2130+
String metricName, ListTagsByMetricNameOptionalParameters parameters) {
2131+
return listTagsByMetricNameWithHttpInfoAsync(metricName, parameters)
2132+
.thenApply(
2133+
response -> {
2134+
return response.getData();
2135+
});
2136+
}
2137+
2138+
/**
2139+
* View indexed and ingested tags for a given metric name. Results are filtered by the <code>
2140+
* window[seconds]</code> parameter, which defaults to 14400 (4 hours).
2141+
*
2142+
* @param metricName The name of the metric. (required)
2143+
* @param parameters Optional parameters for the request.
20232144
* @return ApiResponse&lt;MetricAllTagsResponse&gt;
20242145
* @throws ApiException if fails to make API call
20252146
* @http.response.details
@@ -2033,28 +2154,44 @@ public CompletableFuture<MetricAllTagsResponse> listTagsByMetricNameAsync(String
20332154
* <tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr>
20342155
* </table>
20352156
*/
2036-
public ApiResponse<MetricAllTagsResponse> listTagsByMetricNameWithHttpInfo(String metricName)
2037-
throws ApiException {
2157+
public ApiResponse<MetricAllTagsResponse> listTagsByMetricNameWithHttpInfo(
2158+
String metricName, ListTagsByMetricNameOptionalParameters parameters) throws ApiException {
20382159
Object localVarPostBody = null;
20392160

20402161
// verify the required parameter 'metricName' is set
20412162
if (metricName == null) {
20422163
throw new ApiException(
20432164
400, "Missing the required parameter 'metricName' when calling listTagsByMetricName");
20442165
}
2166+
Long windowSeconds = parameters.windowSeconds;
2167+
String filterTags = parameters.filterTags;
2168+
String filterMatch = parameters.filterMatch;
2169+
Boolean filterIncludeTagValues = parameters.filterIncludeTagValues;
2170+
Boolean filterAllowPartial = parameters.filterAllowPartial;
2171+
Integer pageLimit = parameters.pageLimit;
20452172
// create path and map variables
20462173
String localVarPath =
20472174
"/api/v2/metrics/{metric_name}/all-tags"
20482175
.replaceAll(
20492176
"\\{" + "metric_name" + "\\}", apiClient.escapeString(metricName.toString()));
20502177

2178+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
20512179
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
20522180

2181+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "window[seconds]", windowSeconds));
2182+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags));
2183+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[match]", filterMatch));
2184+
localVarQueryParams.addAll(
2185+
apiClient.parameterToPairs("", "filter[include_tag_values]", filterIncludeTagValues));
2186+
localVarQueryParams.addAll(
2187+
apiClient.parameterToPairs("", "filter[allow_partial]", filterAllowPartial));
2188+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit));
2189+
20532190
Invocation.Builder builder =
20542191
apiClient.createBuilder(
20552192
"v2.MetricsApi.listTagsByMetricName",
20562193
localVarPath,
2057-
new ArrayList<Pair>(),
2194+
localVarQueryParams,
20582195
localVarHeaderParams,
20592196
new HashMap<String, String>(),
20602197
new String[] {"application/json"},
@@ -2076,10 +2213,12 @@ public ApiResponse<MetricAllTagsResponse> listTagsByMetricNameWithHttpInfo(Strin
20762213
* <p>See {@link #listTagsByMetricNameWithHttpInfo}.
20772214
*
20782215
* @param metricName The name of the metric. (required)
2216+
* @param parameters Optional parameters for the request.
20792217
* @return CompletableFuture&lt;ApiResponse&lt;MetricAllTagsResponse&gt;&gt;
20802218
*/
20812219
public CompletableFuture<ApiResponse<MetricAllTagsResponse>>
2082-
listTagsByMetricNameWithHttpInfoAsync(String metricName) {
2220+
listTagsByMetricNameWithHttpInfoAsync(
2221+
String metricName, ListTagsByMetricNameOptionalParameters parameters) {
20832222
Object localVarPostBody = null;
20842223

20852224
// verify the required parameter 'metricName' is set
@@ -2091,21 +2230,37 @@ public ApiResponse<MetricAllTagsResponse> listTagsByMetricNameWithHttpInfo(Strin
20912230
"Missing the required parameter 'metricName' when calling listTagsByMetricName"));
20922231
return result;
20932232
}
2233+
Long windowSeconds = parameters.windowSeconds;
2234+
String filterTags = parameters.filterTags;
2235+
String filterMatch = parameters.filterMatch;
2236+
Boolean filterIncludeTagValues = parameters.filterIncludeTagValues;
2237+
Boolean filterAllowPartial = parameters.filterAllowPartial;
2238+
Integer pageLimit = parameters.pageLimit;
20942239
// create path and map variables
20952240
String localVarPath =
20962241
"/api/v2/metrics/{metric_name}/all-tags"
20972242
.replaceAll(
20982243
"\\{" + "metric_name" + "\\}", apiClient.escapeString(metricName.toString()));
20992244

2245+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
21002246
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
21012247

2248+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "window[seconds]", windowSeconds));
2249+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags));
2250+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[match]", filterMatch));
2251+
localVarQueryParams.addAll(
2252+
apiClient.parameterToPairs("", "filter[include_tag_values]", filterIncludeTagValues));
2253+
localVarQueryParams.addAll(
2254+
apiClient.parameterToPairs("", "filter[allow_partial]", filterAllowPartial));
2255+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit));
2256+
21022257
Invocation.Builder builder;
21032258
try {
21042259
builder =
21052260
apiClient.createBuilder(
21062261
"v2.MetricsApi.listTagsByMetricName",
21072262
localVarPath,
2108-
new ArrayList<Pair>(),
2263+
localVarQueryParams,
21092264
localVarHeaderParams,
21102265
new HashMap<String, String>(),
21112266
new String[] {"application/json"},

src/main/java/com/datadog/api/client/v2/model/MetricAllTags.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import java.util.Map;
1717
import java.util.Objects;
1818

19-
/** Object for a single metric's indexed tags. */
19+
/** Object for a single metric's indexed and ingested tags. */
2020
@JsonPropertyOrder({
2121
MetricAllTags.JSON_PROPERTY_ATTRIBUTES,
2222
MetricAllTags.JSON_PROPERTY_ID,
@@ -42,7 +42,7 @@ public MetricAllTags attributes(MetricAllTagsAttributes attributes) {
4242
}
4343

4444
/**
45-
* Object containing the definition of a metric's tags.
45+
* Object containing the definition of a metric's indexed and ingested tags.
4646
*
4747
* @return attributes
4848
*/

0 commit comments

Comments
 (0)