Skip to content

Commit 3ecc72f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Document metrics volume includes (#1784)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent e3fd168 commit 3ecc72f

11 files changed

Lines changed: 566 additions & 15 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58798,13 +58798,15 @@ components:
5879858798
- token
5879958799
type: object
5880058800
Metric:
58801-
description: Object for a single metric tag configuration.
58801+
description: Object for a single metric.
5880258802
example:
5880358803
id: metric.foo.bar
5880458804
type: metrics
5880558805
properties:
5880658806
id:
5880758807
$ref: "#/components/schemas/MetricName"
58808+
relationships:
58809+
$ref: "#/components/schemas/MetricRelationships"
5880858810
type:
5880958811
$ref: "#/components/schemas/MetricType"
5881058812
type: object
@@ -59341,12 +59343,12 @@ components:
5934159343
description: Object containing the definition of a metric's ingested and indexed volume.
5934259344
properties:
5934359345
indexed_volume:
59344-
description: Indexed volume for the given metric.
59346+
description: Estimated average hourly number of indexed time series for the given metric over the last hour. For organizations on Metric Name Pricing, this represents the estimated sum of indexed data points over the last hour.
5934559347
example: 10
5934659348
format: int64
5934759349
type: integer
5934859350
ingested_volume:
59349-
description: Ingested volume for the given metric.
59351+
description: Estimated average hourly number of ingested time series for the given metric over the last hour. This value is `0` for metrics not configured with Metrics Without Limits. For organizations on Metric Name Pricing, this represents the estimated sum of ingested data points over the last hour.
5935059352
example: 20
5935159353
format: int64
5935259354
type: integer
@@ -59523,6 +59525,12 @@ components:
5952359525
format: double
5952459526
type: number
5952559527
type: object
59528+
MetricRelationships:
59529+
description: Relationships for a metric.
59530+
properties:
59531+
metric_volumes:
59532+
$ref: "#/components/schemas/MetricVolumesRelationship"
59533+
type: object
5952659534
MetricResource:
5952759535
description: Metric resource.
5952859536
example: {name: "dummyhost", type: "host"}
@@ -59715,6 +59723,8 @@ components:
5971559723
$ref: "#/components/schemas/MetricTagConfigurationAttributes"
5971659724
id:
5971759725
$ref: "#/components/schemas/MetricName"
59726+
relationships:
59727+
$ref: "#/components/schemas/MetricRelationships"
5971859728
type:
5971959729
$ref: "#/components/schemas/MetricTagConfigurationType"
5972059730
type: object
@@ -59927,6 +59937,20 @@ components:
5992759937
oneOf:
5992859938
- $ref: "#/components/schemas/MetricDistinctVolume"
5992959939
- $ref: "#/components/schemas/MetricIngestedIndexedVolume"
59940+
MetricVolumesRelationship:
59941+
description: Relationship to a metric volume included in the response.
59942+
properties:
59943+
data:
59944+
$ref: "#/components/schemas/MetricVolumesRelationshipData"
59945+
type: object
59946+
MetricVolumesRelationshipData:
59947+
description: Relationship data for a metric volume.
59948+
properties:
59949+
id:
59950+
$ref: "#/components/schemas/MetricName"
59951+
type:
59952+
$ref: "#/components/schemas/MetricIngestedIndexedVolumeType"
59953+
type: object
5993059954
MetricVolumesResponse:
5993159955
description: Response object which includes a single metric's volume.
5993259956
properties:
@@ -59972,6 +59996,11 @@ components:
5997259996
items:
5997359997
$ref: "#/components/schemas/MetricsAndMetricTagConfigurations"
5997459998
type: array
59999+
included:
60000+
description: Array of metric volume resources included when requested with `include=metric_volumes`.
60001+
items:
60002+
$ref: "#/components/schemas/MetricIngestedIndexedVolume"
60003+
type: array
5997560004
links:
5997660005
$ref: "#/components/schemas/MetricsListResponseLinks"
5997760006
meta:
@@ -152443,13 +152472,20 @@ paths:
152443152472
Query parameters use bracket notation (for example, `filter[tags]`, `filter[queried][window][seconds]`). Pass them as standard URL query strings, URL-encoding the brackets if your client does not handle them. For example: `GET /api/v2/metrics?filter[tags]=env:prod&window[seconds]=86400&page[size]=500`.
152444152473
operationId: ListTagConfigurations
152445152474
parameters:
152446-
- description: Only return custom metrics that have been configured with Metrics Without Limits.
152475+
- description: Only return custom metrics that have been configured (`true`) or not configured (`false`) with Metrics Without Limits.
152447152476
example: true
152448152477
in: query
152449152478
name: filter[configured]
152450152479
required: false
152451152480
schema:
152452152481
type: boolean
152482+
- description: Only return metrics that are eligible (`true`) or ineligible (`false`) for configuration with Metrics Without Limits.
152483+
example: true
152484+
in: query
152485+
name: filter[is_configurable]
152486+
required: false
152487+
schema:
152488+
type: boolean
152453152489
- description: Only return metrics that have the given tag key(s) in their Metrics Without Limits configuration (included or excluded).
152454152490
example: "app,env"
152455152491
in: query
@@ -152507,6 +152543,20 @@ paths:
152507152543
required: false
152508152544
schema:
152509152545
type: boolean
152546+
- description: Include related resources in the response. Set to `metric_volumes` to include indexed and ingested volume counts for each metric.
152547+
example: metric_volumes
152548+
in: query
152549+
name: include
152550+
required: false
152551+
schema:
152552+
type: string
152553+
- description: "Sort results by metric volume. Prefix a key with `-` for descending order. Supported keys: `metric_volumes.indexed_volume`, `metric_volumes.ingested_volume`, `metric_volumes.indexed_volume_delta`, `metric_volumes.ingested_volume_delta`. Requires a paginated request (`page[size]` or `page[cursor]`)."
152554+
example: "-metric_volumes.indexed_volume"
152555+
in: query
152556+
name: sort
152557+
required: false
152558+
schema:
152559+
type: string
152510152560
- description: |-
152511152561
Only return metrics that have been actively reporting in the specified window. The default value is 3600 seconds (1 hour), the maximum value is 2,592,000 seconds (30 days), and the minimum value is 1 second.
152512152562
example: 3600
@@ -152548,6 +152598,34 @@ paths:
152548152598
meta:
152549152599
pagination:
152550152600
next_cursor:
152601+
with_metric_volumes:
152602+
value:
152603+
data:
152604+
- id: user.custom.cpu.usage
152605+
relationships:
152606+
metric_volumes:
152607+
data:
152608+
id: user.custom.cpu.usage
152609+
type: metric_volumes
152610+
type: metrics
152611+
- id: user.custom.mem.usage
152612+
relationships:
152613+
metric_volumes:
152614+
data:
152615+
id: user.custom.mem.usage
152616+
type: metric_volumes
152617+
type: metrics
152618+
included:
152619+
- attributes:
152620+
indexed_volume: 1000
152621+
ingested_volume: 456
152622+
id: user.custom.cpu.usage
152623+
type: metric_volumes
152624+
- attributes:
152625+
indexed_volume: 250
152626+
ingested_volume: 1011
152627+
id: user.custom.mem.usage
152628+
type: metric_volumes
152551152629
schema:
152552152630
$ref: "#/components/schemas/MetricsAndMetricTagConfigurationsResponse"
152553152631
description: Success

src/datadogV2/api/api_metrics.rs

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ impl ListActiveMetricConfigurationsOptionalParams {
7878
#[non_exhaustive]
7979
#[derive(Clone, Default, Debug)]
8080
pub struct ListTagConfigurationsOptionalParams {
81-
/// Only return custom metrics that have been configured with Metrics Without Limits.
81+
/// Only return custom metrics that have been configured (`true`) or not configured (`false`) with Metrics Without Limits.
8282
pub filter_configured: Option<bool>,
83+
/// Only return metrics that are eligible (`true`) or ineligible (`false`) for configuration with Metrics Without Limits.
84+
pub filter_is_configurable: Option<bool>,
8385
/// Only return metrics that have the given tag key(s) in their Metrics Without Limits configuration (included or excluded).
8486
pub filter_tags_configured: Option<String>,
8587
/// Only return metrics of the given metric type.
@@ -95,6 +97,10 @@ pub struct ListTagConfigurationsOptionalParams {
9597
pub filter_tags: Option<String>,
9698
/// Only return metrics that are used in at least one dashboard, monitor, notebook, or SLO.
9799
pub filter_related_assets: Option<bool>,
100+
/// Include related resources in the response. Set to `metric_volumes` to include indexed and ingested volume counts for each metric.
101+
pub include: Option<String>,
102+
/// Sort results by metric volume. Prefix a key with `-` for descending order. Supported keys: `metric_volumes.indexed_volume`, `metric_volumes.ingested_volume`, `metric_volumes.indexed_volume_delta`, `metric_volumes.ingested_volume_delta`. Requires a paginated request (`page[size]` or `page[cursor]`).
103+
pub sort: Option<String>,
98104
/// Only return metrics that have been actively reporting in the specified window. The default value is 3600 seconds (1 hour), the maximum value is 2,592,000 seconds (30 days), and the minimum value is 1 second.
99105
pub window_seconds: Option<i64>,
100106
/// Maximum number of results per page. Send `page[size]` on the first request to opt in to pagination. On each subsequent request, send `page[cursor]` set to the value of `meta.pagination.next_cursor` from the previous response. The default value is 10000, the maximum value is 10000, and the minimum value is 1.
@@ -104,11 +110,16 @@ pub struct ListTagConfigurationsOptionalParams {
104110
}
105111

106112
impl ListTagConfigurationsOptionalParams {
107-
/// Only return custom metrics that have been configured with Metrics Without Limits.
113+
/// Only return custom metrics that have been configured (`true`) or not configured (`false`) with Metrics Without Limits.
108114
pub fn filter_configured(mut self, value: bool) -> Self {
109115
self.filter_configured = Some(value);
110116
self
111117
}
118+
/// Only return metrics that are eligible (`true`) or ineligible (`false`) for configuration with Metrics Without Limits.
119+
pub fn filter_is_configurable(mut self, value: bool) -> Self {
120+
self.filter_is_configurable = Some(value);
121+
self
122+
}
112123
/// Only return metrics that have the given tag key(s) in their Metrics Without Limits configuration (included or excluded).
113124
pub fn filter_tags_configured(mut self, value: String) -> Self {
114125
self.filter_tags_configured = Some(value);
@@ -147,6 +158,16 @@ impl ListTagConfigurationsOptionalParams {
147158
self.filter_related_assets = Some(value);
148159
self
149160
}
161+
/// Include related resources in the response. Set to `metric_volumes` to include indexed and ingested volume counts for each metric.
162+
pub fn include(mut self, value: String) -> Self {
163+
self.include = Some(value);
164+
self
165+
}
166+
/// Sort results by metric volume. Prefix a key with `-` for descending order. Supported keys: `metric_volumes.indexed_volume`, `metric_volumes.ingested_volume`, `metric_volumes.indexed_volume_delta`, `metric_volumes.ingested_volume_delta`. Requires a paginated request (`page[size]` or `page[cursor]`).
167+
pub fn sort(mut self, value: String) -> Self {
168+
self.sort = Some(value);
169+
self
170+
}
150171
/// Only return metrics that have been actively reporting in the specified window. The default value is 3600 seconds (1 hour), the maximum value is 2,592,000 seconds (30 days), and the minimum value is 1 second.
151172
pub fn window_seconds(mut self, value: i64) -> Self {
152173
self.window_seconds = Some(value);
@@ -2607,13 +2628,16 @@ impl MetricsAPI {
26072628

26082629
// unbox and build optional parameters
26092630
let filter_configured = params.filter_configured;
2631+
let filter_is_configurable = params.filter_is_configurable;
26102632
let filter_tags_configured = params.filter_tags_configured;
26112633
let filter_metric_type = params.filter_metric_type;
26122634
let filter_include_percentiles = params.filter_include_percentiles;
26132635
let filter_queried = params.filter_queried;
26142636
let filter_queried_window_seconds = params.filter_queried_window_seconds;
26152637
let filter_tags = params.filter_tags;
26162638
let filter_related_assets = params.filter_related_assets;
2639+
let include = params.include;
2640+
let sort = params.sort;
26172641
let window_seconds = params.window_seconds;
26182642
let page_size = params.page_size;
26192643
let page_cursor = params.page_cursor;
@@ -2631,6 +2655,10 @@ impl MetricsAPI {
26312655
local_req_builder =
26322656
local_req_builder.query(&[("filter[configured]", &local_query_param.to_string())]);
26332657
};
2658+
if let Some(ref local_query_param) = filter_is_configurable {
2659+
local_req_builder = local_req_builder
2660+
.query(&[("filter[is_configurable]", &local_query_param.to_string())]);
2661+
};
26342662
if let Some(ref local_query_param) = filter_tags_configured {
26352663
local_req_builder = local_req_builder
26362664
.query(&[("filter[tags_configured]", &local_query_param.to_string())]);
@@ -2663,6 +2691,14 @@ impl MetricsAPI {
26632691
local_req_builder = local_req_builder
26642692
.query(&[("filter[related_assets]", &local_query_param.to_string())]);
26652693
};
2694+
if let Some(ref local_query_param) = include {
2695+
local_req_builder =
2696+
local_req_builder.query(&[("include", &local_query_param.to_string())]);
2697+
};
2698+
if let Some(ref local_query_param) = sort {
2699+
local_req_builder =
2700+
local_req_builder.query(&[("sort", &local_query_param.to_string())]);
2701+
};
26662702
if let Some(ref local_query_param) = window_seconds {
26672703
local_req_builder =
26682704
local_req_builder.query(&[("window[seconds]", &local_query_param.to_string())]);

src/datadogV2/model/mod.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6544,6 +6544,14 @@ pub mod model_metrics_and_metric_tag_configurations_response;
65446544
pub use self::model_metrics_and_metric_tag_configurations_response::MetricsAndMetricTagConfigurationsResponse;
65456545
pub mod model_metric;
65466546
pub use self::model_metric::Metric;
6547+
pub mod model_metric_relationships;
6548+
pub use self::model_metric_relationships::MetricRelationships;
6549+
pub mod model_metric_volumes_relationship;
6550+
pub use self::model_metric_volumes_relationship::MetricVolumesRelationship;
6551+
pub mod model_metric_volumes_relationship_data;
6552+
pub use self::model_metric_volumes_relationship_data::MetricVolumesRelationshipData;
6553+
pub mod model_metric_ingested_indexed_volume_type;
6554+
pub use self::model_metric_ingested_indexed_volume_type::MetricIngestedIndexedVolumeType;
65476555
pub mod model_metric_type;
65486556
pub use self::model_metric_type::MetricType;
65496557
pub mod model_metric_tag_configuration;
@@ -6562,6 +6570,10 @@ pub mod model_metric_tag_configuration_type;
65626570
pub use self::model_metric_tag_configuration_type::MetricTagConfigurationType;
65636571
pub mod model_metrics_and_metric_tag_configurations;
65646572
pub use self::model_metrics_and_metric_tag_configurations::MetricsAndMetricTagConfigurations;
6573+
pub mod model_metric_ingested_indexed_volume;
6574+
pub use self::model_metric_ingested_indexed_volume::MetricIngestedIndexedVolume;
6575+
pub mod model_metric_ingested_indexed_volume_attributes;
6576+
pub use self::model_metric_ingested_indexed_volume_attributes::MetricIngestedIndexedVolumeAttributes;
65656577
pub mod model_metrics_list_response_links;
65666578
pub use self::model_metrics_list_response_links::MetricsListResponseLinks;
65676579
pub mod model_metric_pagination_meta;
@@ -6740,12 +6752,6 @@ pub mod model_metric_distinct_volume_attributes;
67406752
pub use self::model_metric_distinct_volume_attributes::MetricDistinctVolumeAttributes;
67416753
pub mod model_metric_distinct_volume_type;
67426754
pub use self::model_metric_distinct_volume_type::MetricDistinctVolumeType;
6743-
pub mod model_metric_ingested_indexed_volume;
6744-
pub use self::model_metric_ingested_indexed_volume::MetricIngestedIndexedVolume;
6745-
pub mod model_metric_ingested_indexed_volume_attributes;
6746-
pub use self::model_metric_ingested_indexed_volume_attributes::MetricIngestedIndexedVolumeAttributes;
6747-
pub mod model_metric_ingested_indexed_volume_type;
6748-
pub use self::model_metric_ingested_indexed_volume_type::MetricIngestedIndexedVolumeType;
67496755
pub mod model_metric_volumes;
67506756
pub use self::model_metric_volumes::MetricVolumes;
67516757
pub mod model_model_lab_facet_keys_response;

src/datadogV2/model/model_metric.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ use serde::{Deserialize, Deserializer, Serialize};
66
use serde_with::skip_serializing_none;
77
use std::fmt::{self, Formatter};
88

9-
/// Object for a single metric tag configuration.
9+
/// Object for a single metric.
1010
#[non_exhaustive]
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct Metric {
1414
/// The metric name for this resource.
1515
#[serde(rename = "id")]
1616
pub id: Option<String>,
17+
/// Relationships for a metric.
18+
#[serde(rename = "relationships")]
19+
pub relationships: Option<crate::datadogV2::model::MetricRelationships>,
1720
/// The metric resource type.
1821
#[serde(rename = "type")]
1922
pub type_: Option<crate::datadogV2::model::MetricType>,
@@ -28,6 +31,7 @@ impl Metric {
2831
pub fn new() -> Metric {
2932
Metric {
3033
id: None,
34+
relationships: None,
3135
type_: None,
3236
additional_properties: std::collections::BTreeMap::new(),
3337
_unparsed: false,
@@ -39,6 +43,11 @@ impl Metric {
3943
self
4044
}
4145

46+
pub fn relationships(mut self, value: crate::datadogV2::model::MetricRelationships) -> Self {
47+
self.relationships = Some(value);
48+
self
49+
}
50+
4251
pub fn type_(mut self, value: crate::datadogV2::model::MetricType) -> Self {
4352
self.type_ = Some(value);
4453
self
@@ -77,6 +86,7 @@ impl<'de> Deserialize<'de> for Metric {
7786
M: MapAccess<'a>,
7887
{
7988
let mut id: Option<String> = None;
89+
let mut relationships: Option<crate::datadogV2::model::MetricRelationships> = None;
8090
let mut type_: Option<crate::datadogV2::model::MetricType> = None;
8191
let mut additional_properties: std::collections::BTreeMap<
8292
String,
@@ -92,6 +102,13 @@ impl<'de> Deserialize<'de> for Metric {
92102
}
93103
id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
94104
}
105+
"relationships" => {
106+
if v.is_null() {
107+
continue;
108+
}
109+
relationships =
110+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
111+
}
95112
"type" => {
96113
if v.is_null() {
97114
continue;
@@ -116,6 +133,7 @@ impl<'de> Deserialize<'de> for Metric {
116133

117134
let content = Metric {
118135
id,
136+
relationships,
119137
type_,
120138
additional_properties,
121139
_unparsed,

src/datadogV2/model/model_metric_ingested_indexed_volume_attributes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct MetricIngestedIndexedVolumeAttributes {
14-
/// Indexed volume for the given metric.
14+
/// Estimated average hourly number of indexed time series for the given metric over the last hour. For organizations on Metric Name Pricing, this represents the estimated sum of indexed data points over the last hour.
1515
#[serde(rename = "indexed_volume")]
1616
pub indexed_volume: Option<i64>,
17-
/// Ingested volume for the given metric.
17+
/// Estimated average hourly number of ingested time series for the given metric over the last hour. This value is `0` for metrics not configured with Metrics Without Limits. For organizations on Metric Name Pricing, this represents the estimated sum of ingested data points over the last hour.
1818
#[serde(rename = "ingested_volume")]
1919
pub ingested_volume: Option<i64>,
2020
#[serde(flatten)]

0 commit comments

Comments
 (0)