Skip to content

Commit d6a61c4

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

2 files changed

Lines changed: 27 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/main/java/com/datadog/api/client/v2/api/MetricsApi.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,8 @@ public static class EstimateMetricsOutputSeriesOptionalParameters {
674674
/**
675675
* Set filterGroups.
676676
*
677-
* @param filterGroups Filtered tag keys that the metric is configured to query with. (optional)
677+
* @param filterGroups Comma-separated list of tag keys that the metric is configured to query
678+
* with. For example: <code>filter[groups]=app,host</code>. (optional)
678679
* @return EstimateMetricsOutputSeriesOptionalParameters
679680
*/
680681
public EstimateMetricsOutputSeriesOptionalParameters filterGroups(String filterGroups) {
@@ -1670,10 +1671,12 @@ public ListTagConfigurationsOptionalParameters filterQueried(Boolean filterQueri
16701671
/**
16711672
* Set filterQueriedWindowSeconds.
16721673
*
1673-
* @param filterQueriedWindowSeconds Only return metrics that have been queried or not queried
1674-
* in the specified window. Dependent on being sent with <code>filter[queried]</code>. The
1675-
* default value is 2,592,000 seconds (30 days), the maximum value is 15,552,000 seconds
1676-
* (180 days), and the minimum value is 1 second. (optional, default to 2592000)
1674+
* @param filterQueriedWindowSeconds This parameter has no effect unless <code>filter[queried]
1675+
* </code> is also set. Only return metrics that have been queried or not queried in the
1676+
* specified window. The default value is 2,592,000 seconds (30 days), the maximum value is
1677+
* 15,552,000 seconds (180 days), and the minimum value is 1 second. For example: <code>
1678+
* filter[queried]=true&amp;filter[queried][window][seconds]=604800</code>. (optional,
1679+
* default to 2592000)
16771680
* @return ListTagConfigurationsOptionalParameters
16781681
*/
16791682
public ListTagConfigurationsOptionalParameters filterQueriedWindowSeconds(
@@ -1686,7 +1689,8 @@ public ListTagConfigurationsOptionalParameters filterQueriedWindowSeconds(
16861689
* Set filterTags.
16871690
*
16881691
* @param filterTags Only return metrics that were submitted with tags matching this expression.
1689-
* You can use AND, OR, IN, and wildcards (for example, service:web*). (optional)
1692+
* You can use AND, OR, IN, and wildcards. For example: <code>
1693+
* filter[tags]=env IN (staging,test) AND service:web*</code>. (optional)
16901694
* @return ListTagConfigurationsOptionalParameters
16911695
*/
16921696
public ListTagConfigurationsOptionalParameters filterTags(String filterTags) {
@@ -1723,8 +1727,10 @@ public ListTagConfigurationsOptionalParameters windowSeconds(Long windowSeconds)
17231727
/**
17241728
* Set pageSize.
17251729
*
1726-
* @param pageSize Maximum number of results per page. Use with <code>page[cursor]</code> for
1727-
* pagination. The default value is 10000, the maximum value is 10000, and the minimum value
1730+
* @param pageSize Maximum number of results per page. Send <code>page[size]</code> on the first
1731+
* request to opt in to pagination. On each subsequent request, send <code>page[cursor]
1732+
* </code> set to the value of <code>meta.pagination.next_cursor</code> from the previous
1733+
* response. The default value is 10000, the maximum value is 10000, and the minimum value
17281734
* is 1. (optional, default to 10000)
17291735
* @return ListTagConfigurationsOptionalParameters
17301736
*/
@@ -1867,6 +1873,11 @@ public PaginationIterable<MetricsAndMetricTagConfigurations> listTagConfiguratio
18671873
* Get a list of actively reporting metrics for your organization. Pagination is optional using
18681874
* the <code>page[cursor]</code> and <code>page[size]</code> query parameters.
18691875
*
1876+
* <p>Query parameters use bracket notation (for example, <code>filter[tags]</code>, <code>
1877+
* filter[queried][window][seconds]</code>). Pass them as standard URL query strings, URL-encoding
1878+
* the brackets if your client does not handle them. For example: <code>
1879+
* GET /api/v2/metrics?filter[tags]=env:prod&amp;window[seconds]=86400&amp;page[size]=500</code>.
1880+
*
18701881
* @param parameters Optional parameters for the request.
18711882
* @return ApiResponse&lt;MetricsAndMetricTagConfigurationsResponse&gt;
18721883
* @throws ApiException if fails to make API call

0 commit comments

Comments
 (0)