Skip to content
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
82 changes: 75 additions & 7 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32305,7 +32305,7 @@ components:
x-enum-varnames:
- ACTIVELY_QUERIED_CONFIGURATIONS
MetricAllTags:
description: Object for a single metric's indexed tags.
description: Object for a single metric's indexed and ingested tags.
properties:
attributes:
$ref: '#/components/schemas/MetricAllTagsAttributes'
Expand All @@ -32315,21 +32315,33 @@ components:
$ref: '#/components/schemas/MetricType'
type: object
MetricAllTagsAttributes:
description: Object containing the definition of a metric's tags.
description: Object containing the definition of a metric's indexed and ingested
tags.
properties:
ingested_tags:
description: List of ingested tags that are not indexed.
example:
- env:prod
- service:web
- version:1.0
items:
description: Ingested tags for the metric.
type: string
type: array
tags:
description: List of indexed tag value pairs.
description: List of indexed tags.
example:
- sport:golf
- sport:football
- animal:dog
items:
description: Tag key-value pairs.
description: Indexed tags for the metric.
type: string
type: array
type: object
MetricAllTagsResponse:
description: Response object that includes a single metric's indexed tags.
description: Response object that includes a single metric's indexed and ingested
tags.
properties:
data:
$ref: '#/components/schemas/MetricAllTags'
Expand Down Expand Up @@ -76164,11 +76176,67 @@ paths:
- metrics_read
/api/v2/metrics/{metric_name}/all-tags:
get:
description: View indexed tag key-value pairs for a given metric name over the
previous hour.
description: 'View indexed and ingested tags for a given metric name.

Results are filtered by the `window[seconds]` parameter, which defaults to
14400 (4 hours).'
operationId: ListTagsByMetricName
parameters:
- $ref: '#/components/parameters/MetricName'
- description: 'The number of seconds of look back (from now) to query for tag
data.

Default value is 14400 (4 hours), minimum value is 14400 (4 hours).'
example: 14400
in: query
name: window[seconds]
required: false
schema:
format: int64
type: integer
- description: Filter to specific tags.
example: env,service
in: query
name: filter[tags]
required: false
schema:
type: string
- description: Match pattern for filtering tags.
example: env:prod*
in: query
name: filter[match]
required: false
schema:
type: string
- description: 'Whether to include tag values in the response.

Defaults to true.'
example: true
in: query
name: filter[include_tag_values]
required: false
schema:
type: boolean
- description: 'Whether to allow partial results.

Defaults to false.'
example: false
in: query
name: filter[allow_partial]
required: false
schema:
type: boolean
- description: Maximum number of results to return.
example: 1000
in: query
name: page[limit]
required: false
schema:
default: 1000000
format: int32
maximum: 1000000
minimum: 1
type: integer
responses:
'200':
content:
Expand Down
167 changes: 159 additions & 8 deletions src/main/java/com/datadog/api/client/v2/api/MetricsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,85 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
new GenericType<MetricsAndMetricTagConfigurationsResponse>() {});
}

/** Manage optional parameters to listTagsByMetricName. */
public static class ListTagsByMetricNameOptionalParameters {
private Long windowSeconds;
private String filterTags;
private String filterMatch;
private Boolean filterIncludeTagValues;
private Boolean filterAllowPartial;
private Integer pageLimit;

/**
* Set windowSeconds.
*
* @param windowSeconds The number of seconds of look back (from now) to query for tag data.
* Default value is 14400 (4 hours), minimum value is 14400 (4 hours). (optional)
* @return ListTagsByMetricNameOptionalParameters
*/
public ListTagsByMetricNameOptionalParameters windowSeconds(Long windowSeconds) {
this.windowSeconds = windowSeconds;
return this;
}

/**
* Set filterTags.
*
* @param filterTags Filter to specific tags. (optional)
* @return ListTagsByMetricNameOptionalParameters
*/
public ListTagsByMetricNameOptionalParameters filterTags(String filterTags) {
this.filterTags = filterTags;
return this;
}

/**
* Set filterMatch.
*
* @param filterMatch Match pattern for filtering tags. (optional)
* @return ListTagsByMetricNameOptionalParameters
*/
public ListTagsByMetricNameOptionalParameters filterMatch(String filterMatch) {
this.filterMatch = filterMatch;
return this;
}

/**
* Set filterIncludeTagValues.
*
* @param filterIncludeTagValues Whether to include tag values in the response. Defaults to
* true. (optional)
* @return ListTagsByMetricNameOptionalParameters
*/
public ListTagsByMetricNameOptionalParameters filterIncludeTagValues(
Boolean filterIncludeTagValues) {
this.filterIncludeTagValues = filterIncludeTagValues;
return this;
}

/**
* Set filterAllowPartial.
*
* @param filterAllowPartial Whether to allow partial results. Defaults to false. (optional)
* @return ListTagsByMetricNameOptionalParameters
*/
public ListTagsByMetricNameOptionalParameters filterAllowPartial(Boolean filterAllowPartial) {
this.filterAllowPartial = filterAllowPartial;
return this;
}

/**
* Set pageLimit.
*
* @param pageLimit Maximum number of results to return. (optional, default to 1000000)
* @return ListTagsByMetricNameOptionalParameters
*/
public ListTagsByMetricNameOptionalParameters pageLimit(Integer pageLimit) {
this.pageLimit = pageLimit;
return this;
}
}

/**
* List tags by metric name.
*
Expand All @@ -1998,7 +2077,9 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
* @throws ApiException if fails to make API call
*/
public MetricAllTagsResponse listTagsByMetricName(String metricName) throws ApiException {
return listTagsByMetricNameWithHttpInfo(metricName).getData();
return listTagsByMetricNameWithHttpInfo(
metricName, new ListTagsByMetricNameOptionalParameters())
.getData();
}

/**
Expand All @@ -2010,17 +2091,53 @@ public MetricAllTagsResponse listTagsByMetricName(String metricName) throws ApiE
* @return CompletableFuture&lt;MetricAllTagsResponse&gt;
*/
public CompletableFuture<MetricAllTagsResponse> listTagsByMetricNameAsync(String metricName) {
return listTagsByMetricNameWithHttpInfoAsync(metricName)
return listTagsByMetricNameWithHttpInfoAsync(
metricName, new ListTagsByMetricNameOptionalParameters())
.thenApply(
response -> {
return response.getData();
});
}

/**
* View indexed tag key-value pairs for a given metric name over the previous hour.
* List tags by metric name.
*
* <p>See {@link #listTagsByMetricNameWithHttpInfo}.
*
* @param metricName The name of the metric. (required)
* @param parameters Optional parameters for the request.
* @return MetricAllTagsResponse
* @throws ApiException if fails to make API call
*/
public MetricAllTagsResponse listTagsByMetricName(
String metricName, ListTagsByMetricNameOptionalParameters parameters) throws ApiException {
return listTagsByMetricNameWithHttpInfo(metricName, parameters).getData();
}

/**
* List tags by metric name.
*
* <p>See {@link #listTagsByMetricNameWithHttpInfoAsync}.
*
* @param metricName The name of the metric. (required)
* @param parameters Optional parameters for the request.
* @return CompletableFuture&lt;MetricAllTagsResponse&gt;
*/
public CompletableFuture<MetricAllTagsResponse> listTagsByMetricNameAsync(
String metricName, ListTagsByMetricNameOptionalParameters parameters) {
return listTagsByMetricNameWithHttpInfoAsync(metricName, parameters)
.thenApply(
response -> {
return response.getData();
});
}

/**
* View indexed and ingested tags for a given metric name. Results are filtered by the <code>
* window[seconds]</code> parameter, which defaults to 14400 (4 hours).
*
* @param metricName The name of the metric. (required)
* @param parameters Optional parameters for the request.
* @return ApiResponse&lt;MetricAllTagsResponse&gt;
* @throws ApiException if fails to make API call
* @http.response.details
Expand All @@ -2034,28 +2151,44 @@ public CompletableFuture<MetricAllTagsResponse> listTagsByMetricNameAsync(String
* <tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<MetricAllTagsResponse> listTagsByMetricNameWithHttpInfo(String metricName)
throws ApiException {
public ApiResponse<MetricAllTagsResponse> listTagsByMetricNameWithHttpInfo(
String metricName, ListTagsByMetricNameOptionalParameters parameters) throws ApiException {
Object localVarPostBody = null;

// verify the required parameter 'metricName' is set
if (metricName == null) {
throw new ApiException(
400, "Missing the required parameter 'metricName' when calling listTagsByMetricName");
}
Long windowSeconds = parameters.windowSeconds;
String filterTags = parameters.filterTags;
String filterMatch = parameters.filterMatch;
Boolean filterIncludeTagValues = parameters.filterIncludeTagValues;
Boolean filterAllowPartial = parameters.filterAllowPartial;
Integer pageLimit = parameters.pageLimit;
// create path and map variables
String localVarPath =
"/api/v2/metrics/{metric_name}/all-tags"
.replaceAll(
"\\{" + "metric_name" + "\\}", apiClient.escapeString(metricName.toString()));

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

localVarQueryParams.addAll(apiClient.parameterToPairs("", "window[seconds]", windowSeconds));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[match]", filterMatch));
localVarQueryParams.addAll(
apiClient.parameterToPairs("", "filter[include_tag_values]", filterIncludeTagValues));
localVarQueryParams.addAll(
apiClient.parameterToPairs("", "filter[allow_partial]", filterAllowPartial));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit));

Invocation.Builder builder =
apiClient.createBuilder(
"v2.MetricsApi.listTagsByMetricName",
localVarPath,
new ArrayList<Pair>(),
localVarQueryParams,
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
Expand All @@ -2077,10 +2210,12 @@ public ApiResponse<MetricAllTagsResponse> listTagsByMetricNameWithHttpInfo(Strin
* <p>See {@link #listTagsByMetricNameWithHttpInfo}.
*
* @param metricName The name of the metric. (required)
* @param parameters Optional parameters for the request.
* @return CompletableFuture&lt;ApiResponse&lt;MetricAllTagsResponse&gt;&gt;
*/
public CompletableFuture<ApiResponse<MetricAllTagsResponse>>
listTagsByMetricNameWithHttpInfoAsync(String metricName) {
listTagsByMetricNameWithHttpInfoAsync(
String metricName, ListTagsByMetricNameOptionalParameters parameters) {
Object localVarPostBody = null;

// verify the required parameter 'metricName' is set
Expand All @@ -2092,21 +2227,37 @@ public ApiResponse<MetricAllTagsResponse> listTagsByMetricNameWithHttpInfo(Strin
"Missing the required parameter 'metricName' when calling listTagsByMetricName"));
return result;
}
Long windowSeconds = parameters.windowSeconds;
String filterTags = parameters.filterTags;
String filterMatch = parameters.filterMatch;
Boolean filterIncludeTagValues = parameters.filterIncludeTagValues;
Boolean filterAllowPartial = parameters.filterAllowPartial;
Integer pageLimit = parameters.pageLimit;
// create path and map variables
String localVarPath =
"/api/v2/metrics/{metric_name}/all-tags"
.replaceAll(
"\\{" + "metric_name" + "\\}", apiClient.escapeString(metricName.toString()));

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

localVarQueryParams.addAll(apiClient.parameterToPairs("", "window[seconds]", windowSeconds));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[match]", filterMatch));
localVarQueryParams.addAll(
apiClient.parameterToPairs("", "filter[include_tag_values]", filterIncludeTagValues));
localVarQueryParams.addAll(
apiClient.parameterToPairs("", "filter[allow_partial]", filterAllowPartial));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit));

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.MetricsApi.listTagsByMetricName",
localVarPath,
new ArrayList<Pair>(),
localVarQueryParams,
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.Map;
import java.util.Objects;

/** Object for a single metric's indexed tags. */
/** Object for a single metric's indexed and ingested tags. */
@JsonPropertyOrder({
MetricAllTags.JSON_PROPERTY_ATTRIBUTES,
MetricAllTags.JSON_PROPERTY_ID,
Expand All @@ -42,7 +42,7 @@ public MetricAllTags attributes(MetricAllTagsAttributes attributes) {
}

/**
* Object containing the definition of a metric's tags.
* Object containing the definition of a metric's indexed and ingested tags.
*
* @return attributes
*/
Expand Down
Loading
Loading