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
83 changes: 82 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38508,6 +38508,8 @@ components:
properties:
id:
$ref: '#/components/schemas/MetricName'
relationships:
$ref: '#/components/schemas/MetricRelationships'
type:
$ref: '#/components/schemas/MetricType'
type: object
Expand Down Expand Up @@ -39283,6 +39285,12 @@ components:
format: double
type: number
type: object
MetricRelationships:
description: Relationships to related metric objects.
properties:
metric_volumes:
$ref: '#/components/schemas/MetricVolumesRelationship'
type: object
MetricResource:
description: Metric resource.
example:
Expand Down Expand Up @@ -39726,13 +39734,55 @@ components:
oneOf:
- $ref: '#/components/schemas/MetricDistinctVolume'
- $ref: '#/components/schemas/MetricIngestedIndexedVolume'
MetricVolumesInclude:
description: Relationship data to include in the response.
enum:
- metric_volumes
type: string
x-enum-varnames:
- METRIC_VOLUMES
MetricVolumesRelationship:
description: Relationship to a metric's ingested and indexed volumes.
properties:
data:
$ref: '#/components/schemas/MetricVolumesRelationshipData'
type: object
MetricVolumesRelationshipData:
description: Relationship data for a metric's ingested and indexed volumes.
properties:
id:
$ref: '#/components/schemas/MetricName'
type:
$ref: '#/components/schemas/MetricIngestedIndexedVolumeType'
required:
- type
- id
type: object
MetricVolumesResponse:
description: Response object which includes a single metric's volume.
properties:
data:
$ref: '#/components/schemas/MetricVolumes'
readOnly: true
type: object
MetricVolumesSort:
description: 'Sort metrics by ingested or indexed volume. Use `-` for descending
order.

Supported values: `metric_volumes.indexed_volume`, `-metric_volumes.indexed_volume`,

`metric_volumes.ingested_volume`, `-metric_volumes.ingested_volume`.'
enum:
- metric_volumes.indexed_volume
- -metric_volumes.indexed_volume
- metric_volumes.ingested_volume
- -metric_volumes.ingested_volume
type: string
x-enum-varnames:
- METRIC_VOLUMES_INDEXED_VOLUME
- NOT_METRIC_VOLUMES_INDEXED_VOLUME
- METRIC_VOLUMES_INGESTED_VOLUME
- NOT_METRIC_VOLUMES_INGESTED_VOLUME
MetricsAggregator:
default: avg
description: The type of aggregation that can be performed on metrics-based
Expand Down Expand Up @@ -39772,6 +39822,12 @@ components:
items:
$ref: '#/components/schemas/MetricsAndMetricTagConfigurations'
type: array
included:
description: Array of included metric volume objects. Only present when
`include=metric_volumes` is requested.
items:
$ref: '#/components/schemas/MetricIngestedIndexedVolume'
type: array
links:
$ref: '#/components/schemas/MetricsListResponseLinks'
meta:
Expand Down Expand Up @@ -91435,7 +91491,10 @@ paths:
`next_cursor` value from the response as the new `page[cursor]` value.

Once the `meta.pagination.next_cursor` value is null, all pages have been
retrieved.'
retrieved.

Use `include=metric_volumes` to fetch indexed and ingested volume data for
each metric, and `sort` to order results by volume.'
operationId: ListTagConfigurations
parameters:
- description: Filter custom metrics that have configured tags.
Expand Down Expand Up @@ -91517,6 +91576,28 @@ paths:
required: false
schema:
type: boolean
- description: Relationship data to include in the response. Use `metric_volumes`
to include indexed and ingested volumes.
example: metric_volumes
in: query
name: include
required: false
schema:
$ref: '#/components/schemas/MetricVolumesInclude'
- description: 'Sort metrics by ingested or indexed volume. Use `-` for descending
order.

Supported values: `metric_volumes.indexed_volume`, `-metric_volumes.indexed_volume`,

`metric_volumes.ingested_volume`, `-metric_volumes.ingested_volume`.

Only supported when `include=metric_volumes` is provided.'
example: -metric_volumes.indexed_volume
in: query
name: sort
required: false
schema:
$ref: '#/components/schemas/MetricVolumesSort'
- description: 'The number of seconds of look back (from now) to apply to a
filter[tag] or filter[queried] query.

Expand Down
42 changes: 41 additions & 1 deletion src/main/java/com/datadog/api/client/v2/api/MetricsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import com.datadog.api.client.v2.model.MetricTagConfigurationMetricTypeCategory;
import com.datadog.api.client.v2.model.MetricTagConfigurationResponse;
import com.datadog.api.client.v2.model.MetricTagConfigurationUpdateRequest;
import com.datadog.api.client.v2.model.MetricVolumesInclude;
import com.datadog.api.client.v2.model.MetricVolumesResponse;
import com.datadog.api.client.v2.model.MetricVolumesSort;
import com.datadog.api.client.v2.model.MetricsAndMetricTagConfigurations;
import com.datadog.api.client.v2.model.MetricsAndMetricTagConfigurationsResponse;
import com.datadog.api.client.v2.model.ScalarFormulaQueryRequest;
Expand Down Expand Up @@ -1599,6 +1601,8 @@ public static class ListTagConfigurationsOptionalParameters {
private Long filterQueriedWindowSeconds;
private String filterTags;
private Boolean filterRelatedAssets;
private MetricVolumesInclude include;
private MetricVolumesSort sort;
private Long windowSeconds;
private Integer pageSize;
private String pageCursor;
Expand Down Expand Up @@ -1709,6 +1713,33 @@ public ListTagConfigurationsOptionalParameters filterRelatedAssets(
return this;
}

/**
* Set include.
*
* @param include Relationship data to include in the response. Use <code>metric_volumes</code>
* to include indexed and ingested volumes. (optional)
* @return ListTagConfigurationsOptionalParameters
*/
public ListTagConfigurationsOptionalParameters include(MetricVolumesInclude include) {
this.include = include;
return this;
}

/**
* Set sort.
*
* @param sort Sort metrics by ingested or indexed volume. Use <code>-</code> for descending
* order. Supported values: <code>metric_volumes.indexed_volume</code>, <code>
* -metric_volumes.indexed_volume</code>, <code>metric_volumes.ingested_volume</code>,
* <code>-metric_volumes.ingested_volume</code>. Only supported when <code>
* include=metric_volumes</code> is provided. (optional)
* @return ListTagConfigurationsOptionalParameters
*/
public ListTagConfigurationsOptionalParameters sort(MetricVolumesSort sort) {
this.sort = sort;
return this;
}

/**
* Set windowSeconds.
*
Expand Down Expand Up @@ -1867,7 +1898,8 @@ public PaginationIterable<MetricsAndMetricTagConfigurations> listTagConfiguratio
* page[size]</code> or an empty cursor like <code>page[cursor]=</code>. To fetch the next page,
* pass in the <code>next_cursor</code> value from the response as the new <code>page[cursor]
* </code> value. Once the <code>meta.pagination.next_cursor</code> value is null, all pages have
* been retrieved.
* been retrieved. Use <code>include=metric_volumes</code> to fetch indexed and ingested volume
* data for each metric, and <code>sort</code> to order results by volume.
*
* @param parameters Optional parameters for the request.
* @return ApiResponse&lt;MetricsAndMetricTagConfigurationsResponse&gt;
Expand All @@ -1893,6 +1925,8 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
Long filterQueriedWindowSeconds = parameters.filterQueriedWindowSeconds;
String filterTags = parameters.filterTags;
Boolean filterRelatedAssets = parameters.filterRelatedAssets;
MetricVolumesInclude include = parameters.include;
MetricVolumesSort sort = parameters.sort;
Long windowSeconds = parameters.windowSeconds;
Integer pageSize = parameters.pageSize;
String pageCursor = parameters.pageCursor;
Expand All @@ -1917,6 +1951,8 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags));
localVarQueryParams.addAll(
apiClient.parameterToPairs("", "filter[related_assets]", filterRelatedAssets));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "window[seconds]", windowSeconds));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor));
Expand Down Expand Up @@ -1960,6 +1996,8 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
Long filterQueriedWindowSeconds = parameters.filterQueriedWindowSeconds;
String filterTags = parameters.filterTags;
Boolean filterRelatedAssets = parameters.filterRelatedAssets;
MetricVolumesInclude include = parameters.include;
MetricVolumesSort sort = parameters.sort;
Long windowSeconds = parameters.windowSeconds;
Integer pageSize = parameters.pageSize;
String pageCursor = parameters.pageCursor;
Expand All @@ -1984,6 +2022,8 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags));
localVarQueryParams.addAll(
apiClient.parameterToPairs("", "filter[related_assets]", filterRelatedAssets));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "window[seconds]", windowSeconds));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor));
Expand Down
35 changes: 33 additions & 2 deletions src/main/java/com/datadog/api/client/v2/model/Metric.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@
import java.util.Objects;

/** Object for a single metric tag configuration. */
@JsonPropertyOrder({Metric.JSON_PROPERTY_ID, Metric.JSON_PROPERTY_TYPE})
@JsonPropertyOrder({
Metric.JSON_PROPERTY_ID,
Metric.JSON_PROPERTY_RELATIONSHIPS,
Metric.JSON_PROPERTY_TYPE
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class Metric {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_ID = "id";
private String id;

public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships";
private MetricRelationships relationships;

public static final String JSON_PROPERTY_TYPE = "type";
private MetricType type = MetricType.METRICS;

Expand All @@ -49,6 +56,28 @@ public void setId(String id) {
this.id = id;
}

public Metric relationships(MetricRelationships relationships) {
this.relationships = relationships;
this.unparsed |= relationships.unparsed;
return this;
}

/**
* Relationships to related metric objects.
*
* @return relationships
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_RELATIONSHIPS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public MetricRelationships getRelationships() {
return relationships;
}

public void setRelationships(MetricRelationships relationships) {
this.relationships = relationships;
}

public Metric type(MetricType type) {
this.type = type;
this.unparsed |= !type.isValid();
Expand Down Expand Up @@ -131,20 +160,22 @@ public boolean equals(Object o) {
}
Metric metric = (Metric) o;
return Objects.equals(this.id, metric.id)
&& Objects.equals(this.relationships, metric.relationships)
&& Objects.equals(this.type, metric.type)
&& Objects.equals(this.additionalProperties, metric.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(id, type, additionalProperties);
return Objects.hash(id, relationships, type, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Metric {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
Expand Down
Loading
Loading