Skip to content

Commit ecbd87c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update metrics all-tags endpoint documentation (#3083)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent d5d1263 commit ecbd87c

File tree

5 files changed

+176
-15
lines changed

5 files changed

+176
-15
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 82 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32619,7 +32619,7 @@ components:
3261932619
x-enum-varnames:
3262032620
- ACTIVELY_QUERIED_CONFIGURATIONS
3262132621
MetricAllTags:
32622-
description: Object for a single metric's indexed tags.
32622+
description: Object for a single metric's indexed and ingested tags.
3262332623
properties:
3262432624
attributes:
3262532625
$ref: '#/components/schemas/MetricAllTagsAttributes'
@@ -32629,21 +32629,33 @@ components:
3262932629
$ref: '#/components/schemas/MetricType'
3263032630
type: object
3263132631
MetricAllTagsAttributes:
32632-
description: Object containing the definition of a metric's tags.
32632+
description: Object containing the definition of a metric's indexed and ingested
32633+
tags.
3263332634
properties:
32635+
ingested_tags:
32636+
description: List of ingested tags that are not indexed.
32637+
example:
32638+
- env:prod
32639+
- service:web
32640+
- version:1.0
32641+
items:
32642+
description: Ingested tags for the metric.
32643+
type: string
32644+
type: array
3263432645
tags:
32635-
description: List of indexed tag value pairs.
32646+
description: List of indexed tags.
3263632647
example:
3263732648
- sport:golf
3263832649
- sport:football
3263932650
- animal:dog
3264032651
items:
32641-
description: Tag key-value pairs.
32652+
description: Indexed tags for the metric.
3264232653
type: string
3264332654
type: array
3264432655
type: object
3264532656
MetricAllTagsResponse:
32646-
description: Response object that includes a single metric's indexed tags.
32657+
description: Response object that includes a single metric's indexed and ingested
32658+
tags.
3264732659
properties:
3264832660
data:
3264932661
$ref: '#/components/schemas/MetricAllTags'
@@ -77321,11 +77333,74 @@ paths:
7732177333
- metrics_read
7732277334
/api/v2/metrics/{metric_name}/all-tags:
7732377335
get:
77324-
description: View indexed tag key-value pairs for a given metric name over the
77325-
previous hour.
77336+
description: 'View indexed and ingested tags for a given metric name.
77337+
77338+
Results are filtered by the `window[seconds]` parameter, which defaults to
77339+
14400 (4 hours).'
7732677340
operationId: ListTagsByMetricName
7732777341
parameters:
7732877342
- $ref: '#/components/parameters/MetricName'
77343+
- description: 'The number of seconds of look back (from now) to query for tag
77344+
data.
77345+
77346+
Default value is 14400 (4 hours), minimum value is 14400 (4 hours).'
77347+
example: 14400
77348+
in: query
77349+
name: window[seconds]
77350+
required: false
77351+
schema:
77352+
format: int64
77353+
type: integer
77354+
- description: 'Filter results to tags from data points that have the specified
77355+
tags.
77356+
77357+
For example, `filter[tags]=env:staging,host:123` returns tags only from
77358+
data points with both `env:staging` and `host:123`.'
77359+
example: env:staging,host:123
77360+
in: query
77361+
name: filter[tags]
77362+
required: false
77363+
schema:
77364+
type: string
77365+
- description: 'Filter returned tags to those matching a substring.
77366+
77367+
For example, `filter[match]=env` returns tags like `env:prod`, `environment:staging`,
77368+
etc.'
77369+
example: env
77370+
in: query
77371+
name: filter[match]
77372+
required: false
77373+
schema:
77374+
type: string
77375+
- description: 'Whether to include tag values in the response.
77376+
77377+
Defaults to true.'
77378+
example: true
77379+
in: query
77380+
name: filter[include_tag_values]
77381+
required: false
77382+
schema:
77383+
type: boolean
77384+
- description: 'Whether to allow partial results.
77385+
77386+
Defaults to false.'
77387+
example: false
77388+
in: query
77389+
name: filter[allow_partial]
77390+
required: false
77391+
schema:
77392+
type: boolean
77393+
- description: Maximum number of results to return.
77394+
example: 1000
77395+
in: query
77396+
name: page[limit]
77397+
required: false
77398+
schema:
77399+
default: 1000000
77400+
format: int32
77401+
maximum: 1000000
77402+
minimum: 1
77403+
type: integer
7732977404
responses:
7733077405
'200':
7733177406
content:

src/datadog_api_client/v2/api/metrics_api.py

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,40 @@ def __init__(self, api_client=None):
399399
"attribute": "metric_name",
400400
"location": "path",
401401
},
402+
"window_seconds": {
403+
"openapi_types": (int,),
404+
"attribute": "window[seconds]",
405+
"location": "query",
406+
},
407+
"filter_tags": {
408+
"openapi_types": (str,),
409+
"attribute": "filter[tags]",
410+
"location": "query",
411+
},
412+
"filter_match": {
413+
"openapi_types": (str,),
414+
"attribute": "filter[match]",
415+
"location": "query",
416+
},
417+
"filter_include_tag_values": {
418+
"openapi_types": (bool,),
419+
"attribute": "filter[include_tag_values]",
420+
"location": "query",
421+
},
422+
"filter_allow_partial": {
423+
"openapi_types": (bool,),
424+
"attribute": "filter[allow_partial]",
425+
"location": "query",
426+
},
427+
"page_limit": {
428+
"validation": {
429+
"inclusive_maximum": 1000000,
430+
"inclusive_minimum": 1,
431+
},
432+
"openapi_types": (int,),
433+
"attribute": "page[limit]",
434+
"location": "query",
435+
},
402436
},
403437
headers_map={
404438
"accept": ["application/json"],
@@ -903,18 +937,61 @@ def list_tag_configurations_with_pagination(
903937
def list_tags_by_metric_name(
904938
self,
905939
metric_name: str,
940+
*,
941+
window_seconds: Union[int, UnsetType] = unset,
942+
filter_tags: Union[str, UnsetType] = unset,
943+
filter_match: Union[str, UnsetType] = unset,
944+
filter_include_tag_values: Union[bool, UnsetType] = unset,
945+
filter_allow_partial: Union[bool, UnsetType] = unset,
946+
page_limit: Union[int, UnsetType] = unset,
906947
) -> MetricAllTagsResponse:
907948
"""List tags by metric name.
908949
909-
View indexed tag key-value pairs for a given metric name over the previous hour.
950+
View indexed and ingested tags for a given metric name.
951+
Results are filtered by the ``window[seconds]`` parameter, which defaults to 14400 (4 hours).
910952
911953
:param metric_name: The name of the metric.
912954
:type metric_name: str
955+
:param window_seconds: The number of seconds of look back (from now) to query for tag data.
956+
Default value is 14400 (4 hours), minimum value is 14400 (4 hours).
957+
:type window_seconds: int, optional
958+
:param filter_tags: Filter results to tags from data points that have the specified tags.
959+
For example, ``filter[tags]=env:staging,host:123`` returns tags only from data points with both ``env:staging`` and ``host:123``.
960+
:type filter_tags: str, optional
961+
:param filter_match: Filter returned tags to those matching a substring.
962+
For example, ``filter[match]=env`` returns tags like ``env:prod`` , ``environment:staging`` , etc.
963+
:type filter_match: str, optional
964+
:param filter_include_tag_values: Whether to include tag values in the response.
965+
Defaults to true.
966+
:type filter_include_tag_values: bool, optional
967+
:param filter_allow_partial: Whether to allow partial results.
968+
Defaults to false.
969+
:type filter_allow_partial: bool, optional
970+
:param page_limit: Maximum number of results to return.
971+
:type page_limit: int, optional
913972
:rtype: MetricAllTagsResponse
914973
"""
915974
kwargs: Dict[str, Any] = {}
916975
kwargs["metric_name"] = metric_name
917976

977+
if window_seconds is not unset:
978+
kwargs["window_seconds"] = window_seconds
979+
980+
if filter_tags is not unset:
981+
kwargs["filter_tags"] = filter_tags
982+
983+
if filter_match is not unset:
984+
kwargs["filter_match"] = filter_match
985+
986+
if filter_include_tag_values is not unset:
987+
kwargs["filter_include_tag_values"] = filter_include_tag_values
988+
989+
if filter_allow_partial is not unset:
990+
kwargs["filter_allow_partial"] = filter_allow_partial
991+
992+
if page_limit is not unset:
993+
kwargs["page_limit"] = page_limit
994+
918995
return self._list_tags_by_metric_name_endpoint.call_with_http_info(**kwargs)
919996

920997
def list_volumes_by_metric_name(

src/datadog_api_client/v2/model/metric_all_tags.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ def __init__(
4444
**kwargs,
4545
):
4646
"""
47-
Object for a single metric's indexed tags.
47+
Object for a single metric's indexed and ingested tags.
4848
49-
:param attributes: Object containing the definition of a metric's tags.
49+
:param attributes: Object containing the definition of a metric's indexed and ingested tags.
5050
:type attributes: MetricAllTagsAttributes, optional
5151
5252
:param id: The metric name for this resource.

src/datadog_api_client/v2/model/metric_all_tags_attributes.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,29 @@ class MetricAllTagsAttributes(ModelNormal):
1717
@cached_property
1818
def openapi_types(_):
1919
return {
20+
"ingested_tags": ([str],),
2021
"tags": ([str],),
2122
}
2223

2324
attribute_map = {
25+
"ingested_tags": "ingested_tags",
2426
"tags": "tags",
2527
}
2628

27-
def __init__(self_, tags: Union[List[str], UnsetType] = unset, **kwargs):
29+
def __init__(
30+
self_, ingested_tags: Union[List[str], UnsetType] = unset, tags: Union[List[str], UnsetType] = unset, **kwargs
31+
):
2832
"""
29-
Object containing the definition of a metric's tags.
33+
Object containing the definition of a metric's indexed and ingested tags.
3034
31-
:param tags: List of indexed tag value pairs.
35+
:param ingested_tags: List of ingested tags that are not indexed.
36+
:type ingested_tags: [str], optional
37+
38+
:param tags: List of indexed tags.
3239
:type tags: [str], optional
3340
"""
41+
if ingested_tags is not unset:
42+
kwargs["ingested_tags"] = ingested_tags
3443
if tags is not unset:
3544
kwargs["tags"] = tags
3645
super().__init__(kwargs)

src/datadog_api_client/v2/model/metric_all_tags_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ def openapi_types(_):
3232

3333
def __init__(self_, data: Union[MetricAllTags, UnsetType] = unset, **kwargs):
3434
"""
35-
Response object that includes a single metric's indexed tags.
35+
Response object that includes a single metric's indexed and ingested tags.
3636
37-
:param data: Object for a single metric's indexed tags.
37+
:param data: Object for a single metric's indexed and ingested tags.
3838
:type data: MetricAllTags, optional
3939
"""
4040
if data is not unset:

0 commit comments

Comments
 (0)