Skip to content

Commit 2b4fe50

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Clarify metrics API query strings (#1537)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent af733e0 commit 2b4fe50

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107944,6 +107944,8 @@ paths:
107944107944
get:
107945107945
description: |-
107946107946
Get a list of actively reporting metrics for your organization. Pagination is optional using the `page[cursor]` and `page[size]` query parameters.
107947+
107948+
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`.
107947107949
operationId: ListTagConfigurations
107948107950
parameters:
107949107951
- description: Only return custom metrics that have been configured with Metrics Without Limits.
@@ -107983,7 +107985,7 @@ paths:
107983107985
schema:
107984107986
type: boolean
107985107987
- description: |-
107986-
Only return metrics that have been queried or not queried in the specified window. Dependent on being sent with `filter[queried]`. The default value is 2,592,000 seconds (30 days), the maximum value is 15,552,000 seconds (180 days), and the minimum value is 1 second.
107988+
This parameter has no effect unless `filter[queried]` is also set. Only return metrics that have been queried or not queried in the specified window. The default value is 2,592,000 seconds (30 days), the maximum value is 15,552,000 seconds (180 days), and the minimum value is 1 second. For example: `filter[queried]=true&filter[queried][window][seconds]=604800`.
107987107989
example: 15552000
107988107990
in: query
107989107991
name: filter[queried][window][seconds]
@@ -107995,7 +107997,7 @@ paths:
107995107997
minimum: 1
107996107998
type: integer
107997107999
- description: |-
107998-
Only return metrics that were submitted with tags matching this expression. You can use AND, OR, IN, and wildcards (for example, service:web*).
108000+
Only return metrics that were submitted with tags matching this expression. You can use AND, OR, IN, and wildcards. For example: `filter[tags]=env IN (staging,test) AND service:web*`.
107999108001
example: "env IN (staging,test) AND service:web*"
108000108002
in: query
108001108003
name: filter[tags]
@@ -108022,7 +108024,8 @@ paths:
108022108024
maximum: 2592000
108023108025
minimum: 1
108024108026
type: integer
108025-
- description: Maximum number of results per page. Use with `page[cursor]` for pagination. The default value is 10000, the maximum value is 10000, and the minimum value is 1.
108027+
- description: |-
108028+
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.
108026108029
in: query
108027108030
name: page[size]
108028108031
required: false
@@ -108426,7 +108429,8 @@ paths:
108426108429
operationId: EstimateMetricsOutputSeries
108427108430
parameters:
108428108431
- $ref: "#/components/parameters/MetricName"
108429-
- description: Filtered tag keys that the metric is configured to query with.
108432+
- description: |-
108433+
Comma-separated list of tag keys that the metric is configured to query with. For example: `filter[groups]=app,host`.
108430108434
example: "app,host"
108431108435
in: query
108432108436
name: filter[groups]

src/datadogV2/api/api_metrics.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::io::Write;
1616
#[non_exhaustive]
1717
#[derive(Clone, Default, Debug)]
1818
pub struct EstimateMetricsOutputSeriesOptionalParams {
19-
/// Filtered tag keys that the metric is configured to query with.
19+
/// Comma-separated list of tag keys that the metric is configured to query with. For example: `filter[groups]=app,host`.
2020
pub filter_groups: Option<String>,
2121
/// The number of hours of look back (from now) to estimate cardinality with. If unspecified, it defaults to 0 hours.
2222
pub filter_hours_ago: Option<i32>,
@@ -29,7 +29,7 @@ pub struct EstimateMetricsOutputSeriesOptionalParams {
2929
}
3030

3131
impl EstimateMetricsOutputSeriesOptionalParams {
32-
/// Filtered tag keys that the metric is configured to query with.
32+
/// Comma-separated list of tag keys that the metric is configured to query with. For example: `filter[groups]=app,host`.
3333
pub fn filter_groups(mut self, value: String) -> Self {
3434
self.filter_groups = Some(value);
3535
self
@@ -89,15 +89,15 @@ pub struct ListTagConfigurationsOptionalParams {
8989
pub filter_include_percentiles: Option<bool>,
9090
/// Only return metrics that have been queried (true) or not queried (false) in the look back window. Set the window with `filter[queried][window][seconds]`; if omitted, a default window is used.
9191
pub filter_queried: Option<bool>,
92-
/// Only return metrics that have been queried or not queried in the specified window. Dependent on being sent with `filter[queried]`. The default value is 2,592,000 seconds (30 days), the maximum value is 15,552,000 seconds (180 days), and the minimum value is 1 second.
92+
/// This parameter has no effect unless `filter[queried]` is also set. Only return metrics that have been queried or not queried in the specified window. The default value is 2,592,000 seconds (30 days), the maximum value is 15,552,000 seconds (180 days), and the minimum value is 1 second. For example: `filter[queried]=true&filter[queried][window][seconds]=604800`.
9393
pub filter_queried_window_seconds: Option<i64>,
94-
/// Only return metrics that were submitted with tags matching this expression. You can use AND, OR, IN, and wildcards (for example, service:web*).
94+
/// Only return metrics that were submitted with tags matching this expression. You can use AND, OR, IN, and wildcards. For example: `filter[tags]=env IN (staging,test) AND service:web*`.
9595
pub filter_tags: Option<String>,
9696
/// Only return metrics that are used in at least one dashboard, monitor, notebook, or SLO.
9797
pub filter_related_assets: Option<bool>,
9898
/// 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.
9999
pub window_seconds: Option<i64>,
100-
/// Maximum number of results per page. Use with `page[cursor]` for pagination. The default value is 10000, the maximum value is 10000, and the minimum value is 1.
100+
/// 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.
101101
pub page_size: Option<i32>,
102102
/// Cursor for pagination. Use `page[size]` to opt-in to pagination and get the first page; for subsequent pages, use the value from `meta.pagination.next_cursor` in the response. Pagination is complete when `next_cursor` is null.
103103
pub page_cursor: Option<String>,
@@ -132,12 +132,12 @@ impl ListTagConfigurationsOptionalParams {
132132
self.filter_queried = Some(value);
133133
self
134134
}
135-
/// Only return metrics that have been queried or not queried in the specified window. Dependent on being sent with `filter[queried]`. The default value is 2,592,000 seconds (30 days), the maximum value is 15,552,000 seconds (180 days), and the minimum value is 1 second.
135+
/// This parameter has no effect unless `filter[queried]` is also set. Only return metrics that have been queried or not queried in the specified window. The default value is 2,592,000 seconds (30 days), the maximum value is 15,552,000 seconds (180 days), and the minimum value is 1 second. For example: `filter[queried]=true&filter[queried][window][seconds]=604800`.
136136
pub fn filter_queried_window_seconds(mut self, value: i64) -> Self {
137137
self.filter_queried_window_seconds = Some(value);
138138
self
139139
}
140-
/// Only return metrics that were submitted with tags matching this expression. You can use AND, OR, IN, and wildcards (for example, service:web*).
140+
/// Only return metrics that were submitted with tags matching this expression. You can use AND, OR, IN, and wildcards. For example: `filter[tags]=env IN (staging,test) AND service:web*`.
141141
pub fn filter_tags(mut self, value: String) -> Self {
142142
self.filter_tags = Some(value);
143143
self
@@ -152,7 +152,7 @@ impl ListTagConfigurationsOptionalParams {
152152
self.window_seconds = Some(value);
153153
self
154154
}
155-
/// Maximum number of results per page. Use with `page[cursor]` for pagination. The default value is 10000, the maximum value is 10000, and the minimum value is 1.
155+
/// 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.
156156
pub fn page_size(mut self, value: i32) -> Self {
157157
self.page_size = Some(value);
158158
self
@@ -1657,6 +1657,8 @@ impl MetricsAPI {
16571657
}
16581658

16591659
/// Get a list of actively reporting metrics for your organization. Pagination is optional using the `page[cursor]` and `page[size]` query parameters.
1660+
///
1661+
/// 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`.
16601662
pub async fn list_tag_configurations(
16611663
&self,
16621664
params: ListTagConfigurationsOptionalParams,
@@ -1717,6 +1719,8 @@ impl MetricsAPI {
17171719
}
17181720

17191721
/// Get a list of actively reporting metrics for your organization. Pagination is optional using the `page[cursor]` and `page[size]` query parameters.
1722+
///
1723+
/// 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`.
17201724
pub async fn list_tag_configurations_with_http_info(
17211725
&self,
17221726
params: ListTagConfigurationsOptionalParams,

0 commit comments

Comments
 (0)