Skip to content

Commit 24c1b00

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update documentation for api/v2/metrics endpoint (#3310)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 071446d commit 24c1b00

File tree

2 files changed

+60
-101
lines changed

2 files changed

+60
-101
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 32 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -91733,111 +91733,92 @@ paths:
9173391733
- logs_read_data
9173491734
/api/v2/metrics:
9173591735
get:
91736-
description: 'Returns all metrics for your organization that match the given
91737-
filter parameters.
91738-
91739-
Optionally, paginate by using the `page[cursor]` and/or `page[size]` query
91740-
parameters.
91741-
91742-
To fetch the first page, pass in a query parameter with either a valid `page[size]`
91743-
or an empty cursor like `page[cursor]=`. To fetch the next page, pass in the
91744-
`next_cursor` value from the response as the new `page[cursor]` value.
91745-
91746-
Once the `meta.pagination.next_cursor` value is null, all pages have been
91747-
retrieved.'
91736+
description: Get a list of actively reporting metrics for your organization.
91737+
Pagination is optional using the `page[cursor]` and `page[size]` query parameters.
9174891738
operationId: ListTagConfigurations
9174991739
parameters:
91750-
- description: Filter custom metrics that have configured tags.
91740+
- description: Only return custom metrics that have been configured with Metrics
91741+
Without Limits.
9175191742
example: true
9175291743
in: query
9175391744
name: filter[configured]
9175491745
required: false
9175591746
schema:
9175691747
type: boolean
91757-
- description: Filter tag configurations by configured tags.
91758-
example: app
91748+
- description: Only return metrics that have the given tag key(s) in their Metrics
91749+
Without Limits configuration (included or excluded).
91750+
example: app,env
9175991751
in: query
9176091752
name: filter[tags_configured]
9176191753
required: false
9176291754
schema:
9176391755
description: Tag keys to filter by.
9176491756
type: string
91765-
- description: Filter metrics by metric type.
91757+
- description: Only return metrics of the given metric type.
9176691758
in: query
9176791759
name: filter[metric_type]
9176891760
required: false
9176991761
schema:
9177091762
$ref: '#/components/schemas/MetricTagConfigurationMetricTypeCategory'
91771-
- description: 'Filter distributions with additional percentile
91772-
91773-
aggregations enabled or disabled.'
91763+
- description: Only return distribution metrics that have percentile aggregations
91764+
enabled (true) or disabled (false).
9177491765
example: true
9177591766
in: query
9177691767
name: filter[include_percentiles]
9177791768
required: false
9177891769
schema:
9177991770
type: boolean
91780-
- description: '(Preview) Filter custom metrics that have or have not been queried
91781-
in the specified window[seconds].
91782-
91783-
If no window is provided or the window is less than 2 hours, a default of
91784-
2 hours will be applied.'
91771+
- description: Only return metrics that have been queried (true) or not queried
91772+
(false) in the look back window. Set the window with `filter[queried][window][seconds]`;
91773+
if omitted, a default window is used.
9178591774
example: true
9178691775
in: query
9178791776
name: filter[queried]
9178891777
required: false
9178991778
schema:
9179091779
type: boolean
91791-
- description: 'The number of seconds of look back (from now) used by the `filter[queried]`
91792-
filter logic.
91793-
91794-
Must be sent with `filter[queried]` and is only applied when `filter[queried]=true`.
91795-
91796-
If `filter[queried]=false`, this parameter is ignored and default queried-window
91797-
behavior applies.
91798-
91799-
If `filter[queried]` is not provided, sending this parameter returns a 400.
91800-
91801-
For example: `GET /api/v2/metrics?filter[queried]=true&filter[queried][window][seconds]=15552000`.'
91780+
- description: Only return metrics that have been queried or not queried in
91781+
the specified window. Dependent on being sent with `filter[queried]`.
9180291782
example: 15552000
9180391783
in: query
9180491784
name: filter[queried][window][seconds]
9180591785
required: false
9180691786
schema:
91787+
default: 2592000
9180791788
format: int64
9180891789
maximum: 15552000
91809-
minimum: 0
91790+
minimum: 1
9181091791
type: integer
91811-
- description: 'Filter metrics that have been submitted with the given tags.
91812-
Supports boolean and wildcard expressions.
91813-
91814-
Can only be combined with the filter[queried] filter.'
91815-
example: env IN (staging,test) AND service:web
91792+
- description: Only return metrics that were submitted with tags matching this
91793+
expression. You can use AND, OR, IN, and wildcards (for example, service:web*).
91794+
example: env IN (staging,test) AND service:web*
9181691795
in: query
9181791796
name: filter[tags]
9181891797
required: false
9181991798
schema:
9182091799
type: string
91821-
- description: (Preview) Filter metrics that are used in dashboards, monitors,
91822-
notebooks, SLOs.
91800+
- description: Only return metrics that are used in at least one dashboard,
91801+
monitor, notebook, or SLO.
9182391802
example: true
9182491803
in: query
9182591804
name: filter[related_assets]
9182691805
required: false
9182791806
schema:
9182891807
type: boolean
91829-
- description: 'The number of seconds of look back (from now) to apply to a
91830-
filter[tag] query.
91831-
91832-
Default value is 3600 (1 hour), maximum value is 5,184,000 (60 days).'
91808+
- description: Only return metrics that have been actively reporting in the
91809+
specified window.
9183391810
example: 3600
9183491811
in: query
9183591812
name: window[seconds]
9183691813
required: false
9183791814
schema:
91815+
default: 3600
9183891816
format: int64
91817+
maximum: 2592000
91818+
minimum: 1
9183991819
type: integer
91840-
- description: Maximum number of results returned.
91820+
- description: Maximum number of results per page. Use with `page[cursor]` for
91821+
pagination.
9184191822
in: query
9184291823
name: page[size]
9184391824
required: false
@@ -91847,12 +91828,9 @@ paths:
9184791828
maximum: 10000
9184891829
minimum: 1
9184991830
type: integer
91850-
- description: 'String to query the next page of results.
91851-
91852-
This key is provided with each valid response from the API in `meta.pagination.next_cursor`.
91853-
91854-
Once the `meta.pagination.next_cursor` key is null, all pages have been
91855-
retrieved.'
91831+
- description: Cursor for pagination. Use `page[size]` to opt-in to pagination
91832+
and get the first page; for subsequent pages, use the value from `meta.pagination.next_cursor`
91833+
in the response. Pagination is complete when `next_cursor` is null.
9185691834
in: query
9185791835
name: page[cursor]
9185891836
required: false

src/datadog_api_client/v2/api/metrics_api.py

Lines changed: 28 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def __init__(self, api_client=None):
350350
"filter_queried_window_seconds": {
351351
"validation": {
352352
"inclusive_maximum": 15552000,
353-
"inclusive_minimum": 0,
353+
"inclusive_minimum": 1,
354354
},
355355
"openapi_types": (int,),
356356
"attribute": "filter[queried][window][seconds]",
@@ -367,6 +367,10 @@ def __init__(self, api_client=None):
367367
"location": "query",
368368
},
369369
"window_seconds": {
370+
"validation": {
371+
"inclusive_maximum": 2592000,
372+
"inclusive_minimum": 1,
373+
},
370374
"openapi_types": (int,),
371375
"attribute": "window[seconds]",
372376
"location": "query",
@@ -788,42 +792,29 @@ def list_tag_configurations(
788792
) -> MetricsAndMetricTagConfigurationsResponse:
789793
"""Get a list of metrics.
790794
791-
Returns all metrics for your organization that match the given filter parameters.
792-
Optionally, paginate by using the ``page[cursor]`` and/or ``page[size]`` query parameters.
793-
To fetch the first page, pass in a query parameter with either a valid ``page[size]`` or an empty cursor like ``page[cursor]=``. To fetch the next page, pass in the ``next_cursor`` value from the response as the new ``page[cursor]`` value.
794-
Once the ``meta.pagination.next_cursor`` value is null, all pages have been retrieved.
795+
Get a list of actively reporting metrics for your organization. Pagination is optional using the ``page[cursor]`` and ``page[size]`` query parameters.
795796
796-
:param filter_configured: Filter custom metrics that have configured tags.
797+
:param filter_configured: Only return custom metrics that have been configured with Metrics Without Limits.
797798
:type filter_configured: bool, optional
798-
:param filter_tags_configured: Filter tag configurations by configured tags.
799+
:param filter_tags_configured: Only return metrics that have the given tag key(s) in their Metrics Without Limits configuration (included or excluded).
799800
:type filter_tags_configured: str, optional
800-
:param filter_metric_type: Filter metrics by metric type.
801+
:param filter_metric_type: Only return metrics of the given metric type.
801802
:type filter_metric_type: MetricTagConfigurationMetricTypeCategory, optional
802-
:param filter_include_percentiles: Filter distributions with additional percentile
803-
aggregations enabled or disabled.
803+
:param filter_include_percentiles: Only return distribution metrics that have percentile aggregations enabled (true) or disabled (false).
804804
:type filter_include_percentiles: bool, optional
805-
:param filter_queried: (Preview) Filter custom metrics that have or have not been queried in the specified window[seconds].
806-
If no window is provided or the window is less than 2 hours, a default of 2 hours will be applied.
805+
:param filter_queried: 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.
807806
:type filter_queried: bool, optional
808-
:param filter_queried_window_seconds: The number of seconds of look back (from now) used by the ``filter[queried]`` filter logic.
809-
Must be sent with ``filter[queried]`` and is only applied when ``filter[queried]=true``.
810-
If ``filter[queried]=false`` , this parameter is ignored and default queried-window behavior applies.
811-
If ``filter[queried]`` is not provided, sending this parameter returns a 400.
812-
For example: ``GET /api/v2/metrics?filter[queried]=true&filter[queried][window][seconds]=15552000``.
807+
:param filter_queried_window_seconds: Only return metrics that have been queried or not queried in the specified window. Dependent on being sent with ``filter[queried]``.
813808
:type filter_queried_window_seconds: int, optional
814-
:param filter_tags: Filter metrics that have been submitted with the given tags. Supports boolean and wildcard expressions.
815-
Can only be combined with the filter[queried] filter.
809+
:param filter_tags: Only return metrics that were submitted with tags matching this expression. You can use AND, OR, IN, and wildcards (for example, service:web*).
816810
:type filter_tags: str, optional
817-
:param filter_related_assets: (Preview) Filter metrics that are used in dashboards, monitors, notebooks, SLOs.
811+
:param filter_related_assets: Only return metrics that are used in at least one dashboard, monitor, notebook, or SLO.
818812
:type filter_related_assets: bool, optional
819-
:param window_seconds: The number of seconds of look back (from now) to apply to a filter[tag] query.
820-
Default value is 3600 (1 hour), maximum value is 5,184,000 (60 days).
813+
:param window_seconds: Only return metrics that have been actively reporting in the specified window.
821814
:type window_seconds: int, optional
822-
:param page_size: Maximum number of results returned.
815+
:param page_size: Maximum number of results per page. Use with ``page[cursor]`` for pagination.
823816
:type page_size: int, optional
824-
:param page_cursor: String to query the next page of results.
825-
This key is provided with each valid response from the API in ``meta.pagination.next_cursor``.
826-
Once the ``meta.pagination.next_cursor`` key is null, all pages have been retrieved.
817+
:param page_cursor: 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.
827818
:type page_cursor: str, optional
828819
:rtype: MetricsAndMetricTagConfigurationsResponse
829820
"""
@@ -882,37 +873,27 @@ def list_tag_configurations_with_pagination(
882873
883874
Provide a paginated version of :meth:`list_tag_configurations`, returning all items.
884875
885-
:param filter_configured: Filter custom metrics that have configured tags.
876+
:param filter_configured: Only return custom metrics that have been configured with Metrics Without Limits.
886877
:type filter_configured: bool, optional
887-
:param filter_tags_configured: Filter tag configurations by configured tags.
878+
:param filter_tags_configured: Only return metrics that have the given tag key(s) in their Metrics Without Limits configuration (included or excluded).
888879
:type filter_tags_configured: str, optional
889-
:param filter_metric_type: Filter metrics by metric type.
880+
:param filter_metric_type: Only return metrics of the given metric type.
890881
:type filter_metric_type: MetricTagConfigurationMetricTypeCategory, optional
891-
:param filter_include_percentiles: Filter distributions with additional percentile
892-
aggregations enabled or disabled.
882+
:param filter_include_percentiles: Only return distribution metrics that have percentile aggregations enabled (true) or disabled (false).
893883
:type filter_include_percentiles: bool, optional
894-
:param filter_queried: (Preview) Filter custom metrics that have or have not been queried in the specified window[seconds].
895-
If no window is provided or the window is less than 2 hours, a default of 2 hours will be applied.
884+
:param filter_queried: 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.
896885
:type filter_queried: bool, optional
897-
:param filter_queried_window_seconds: The number of seconds of look back (from now) used by the ``filter[queried]`` filter logic.
898-
Must be sent with ``filter[queried]`` and is only applied when ``filter[queried]=true``.
899-
If ``filter[queried]=false`` , this parameter is ignored and default queried-window behavior applies.
900-
If ``filter[queried]`` is not provided, sending this parameter returns a 400.
901-
For example: ``GET /api/v2/metrics?filter[queried]=true&filter[queried][window][seconds]=15552000``.
886+
:param filter_queried_window_seconds: Only return metrics that have been queried or not queried in the specified window. Dependent on being sent with ``filter[queried]``.
902887
:type filter_queried_window_seconds: int, optional
903-
:param filter_tags: Filter metrics that have been submitted with the given tags. Supports boolean and wildcard expressions.
904-
Can only be combined with the filter[queried] filter.
888+
:param filter_tags: Only return metrics that were submitted with tags matching this expression. You can use AND, OR, IN, and wildcards (for example, service:web*).
905889
:type filter_tags: str, optional
906-
:param filter_related_assets: (Preview) Filter metrics that are used in dashboards, monitors, notebooks, SLOs.
890+
:param filter_related_assets: Only return metrics that are used in at least one dashboard, monitor, notebook, or SLO.
907891
:type filter_related_assets: bool, optional
908-
:param window_seconds: The number of seconds of look back (from now) to apply to a filter[tag] query.
909-
Default value is 3600 (1 hour), maximum value is 5,184,000 (60 days).
892+
:param window_seconds: Only return metrics that have been actively reporting in the specified window.
910893
:type window_seconds: int, optional
911-
:param page_size: Maximum number of results returned.
894+
:param page_size: Maximum number of results per page. Use with ``page[cursor]`` for pagination.
912895
:type page_size: int, optional
913-
:param page_cursor: String to query the next page of results.
914-
This key is provided with each valid response from the API in ``meta.pagination.next_cursor``.
915-
Once the ``meta.pagination.next_cursor`` key is null, all pages have been retrieved.
896+
:param page_cursor: 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.
916897
:type page_cursor: str, optional
917898
918899
:return: A generator of paginated results.

0 commit comments

Comments
 (0)