Skip to content

Commit df471b3

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add tag exclusion field to metrics configuration API (#1453)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 667237e commit df471b3

File tree

7 files changed

+91
-8
lines changed

7 files changed

+91
-8
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2023-10-31 16:58:24.822581",
8-
"spec_repo_commit": "781a7cfb"
7+
"regenerated": "2023-11-02 14:42:10.925915",
8+
"spec_repo_commit": "97ff7561"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2023-10-31 16:58:24.844717",
13-
"spec_repo_commit": "781a7cfb"
12+
"regenerated": "2023-11-02 14:42:10.940908",
13+
"spec_repo_commit": "97ff7561"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9530,6 +9530,15 @@ components:
95309530
properties:
95319531
emails:
95329532
$ref: '#/components/schemas/MetricBulkTagConfigEmailList'
9533+
exclude_tags_mode:
9534+
description: 'When set to true, the configuration will exclude the configured
9535+
tags and include any other submitted tags.
9536+
9537+
When set to false, the configuration will include the configured tags
9538+
and exclude any other submitted tags.
9539+
9540+
Defaults to false.'
9541+
type: boolean
95339542
tags:
95349543
$ref: '#/components/schemas/MetricBulkTagConfigTagNameList'
95359544
type: object
@@ -9610,6 +9619,13 @@ components:
96109619
properties:
96119620
emails:
96129621
$ref: '#/components/schemas/MetricBulkTagConfigEmailList'
9622+
exclude_tags_mode:
9623+
description: 'When set to true, the configuration will exclude the configured
9624+
tags and include any other submitted tags.
9625+
9626+
When set to false, the configuration will include the configured tags
9627+
and exclude any other submitted tags.'
9628+
type: boolean
96139629
status:
96149630
description: The status of the request.
96159631
example: Accepted
@@ -10074,6 +10090,15 @@ components:
1007410090
example: '2020-03-25T09:48:37.463835Z'
1007510091
format: date-time
1007610092
type: string
10093+
exclude_tags_mode:
10094+
description: 'When set to true, the configuration will exclude the configured
10095+
tags and include any other submitted tags.
10096+
10097+
When set to false, the configuration will include the configured tags
10098+
and exclude any other submitted tags.
10099+
10100+
Defaults to false. Requires `tags` property.'
10101+
type: boolean
1007710102
include_percentiles:
1007810103
description: 'Toggle to include or exclude percentile aggregations for distribution
1007910104
metrics.
@@ -10104,6 +10129,15 @@ components:
1010410129
properties:
1010510130
aggregations:
1010610131
$ref: '#/components/schemas/MetricCustomAggregations'
10132+
exclude_tags_mode:
10133+
description: 'When set to true, the configuration will exclude the configured
10134+
tags and include any other submitted tags.
10135+
10136+
When set to false, the configuration will include the configured tags
10137+
and exclude any other submitted tags.
10138+
10139+
Defaults to false. Requires `tags` property.'
10140+
type: boolean
1010710141
include_percentiles:
1010810142
description: 'Toggle to include/exclude percentiles for a distribution metric.
1010910143

@@ -23621,7 +23655,11 @@ paths:
2362123655
If multiple calls include the same metric, the last configuration applied
2362223656
(not by submit order) is used, do not
2362323657

23624-
expect deterministic ordering of concurrent calls.
23658+
expect deterministic ordering of concurrent calls. The `exclude_tags_mode`
23659+
value will set all metrics that match the prefix to
23660+
23661+
the same exclusion state, metric tag configurations do not support mixed inclusion
23662+
and exclusion for tags on the same metric.
2362523663

2362623664
Can only be used with application keys of users with the `Manage Tags for
2362723665
Metrics` permission.'
@@ -24002,7 +24040,11 @@ paths:
2400224040
Optionally, include percentile aggregations on any distribution metric or
2400324041
configure custom aggregations
2400424042

24005-
on any count, rate, or gauge metric.
24043+
on any count, rate, or gauge metric. By setting `exclude_tags_mode` to true
24044+
the behavior is changed
24045+
24046+
from an allow-list to a deny-list, and tags in the defined list will not be
24047+
queryable.
2400624048

2400724049
Can only be used with application keys of users with the `Manage Tags for
2400824050
Metrics` permission.'

src/datadog_api_client/v2/api/metrics_api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,8 @@ def create_bulk_tags_metrics_configuration(
454454
Metrics are selected by passing a metric name prefix. Use the Delete method of this API path to remove tag configurations.
455455
Results can be sent to a set of account email addresses, just like the same operation in the Datadog web app.
456456
If multiple calls include the same metric, the last configuration applied (not by submit order) is used, do not
457-
expect deterministic ordering of concurrent calls.
457+
expect deterministic ordering of concurrent calls. The ``exclude_tags_mode`` value will set all metrics that match the prefix to
458+
the same exclusion state, metric tag configurations do not support mixed inclusion and exclusion for tags on the same metric.
458459
Can only be used with application keys of users with the ``Manage Tags for Metrics`` permission.
459460
460461
:type body: MetricBulkTagConfigCreateRequest
@@ -474,7 +475,8 @@ def create_tag_configuration(
474475
475476
Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric.
476477
Optionally, include percentile aggregations on any distribution metric or configure custom aggregations
477-
on any count, rate, or gauge metric.
478+
on any count, rate, or gauge metric. By setting ``exclude_tags_mode`` to true the behavior is changed
479+
from an allow-list to a deny-list, and tags in the defined list will not be queryable.
478480
Can only be used with application keys of users with the ``Manage Tags for Metrics`` permission.
479481
480482
:param metric_name: The name of the metric.

src/datadog_api_client/v2/model/metric_bulk_tag_config_create_attributes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,20 @@ def openapi_types(_):
2626

2727
return {
2828
"emails": (MetricBulkTagConfigEmailList,),
29+
"exclude_tags_mode": (bool,),
2930
"tags": (MetricBulkTagConfigTagNameList,),
3031
}
3132

3233
attribute_map = {
3334
"emails": "emails",
35+
"exclude_tags_mode": "exclude_tags_mode",
3436
"tags": "tags",
3537
}
3638

3739
def __init__(
3840
self_,
3941
emails: Union[MetricBulkTagConfigEmailList, UnsetType] = unset,
42+
exclude_tags_mode: Union[bool, UnsetType] = unset,
4043
tags: Union[MetricBulkTagConfigTagNameList, UnsetType] = unset,
4144
**kwargs,
4245
):
@@ -46,11 +49,18 @@ def __init__(
4649
:param emails: A list of account emails to notify when the configuration is applied.
4750
:type emails: MetricBulkTagConfigEmailList, optional
4851
52+
:param exclude_tags_mode: When set to true, the configuration will exclude the configured tags and include any other submitted tags.
53+
When set to false, the configuration will include the configured tags and exclude any other submitted tags.
54+
Defaults to false.
55+
:type exclude_tags_mode: bool, optional
56+
4957
:param tags: A list of tag names to apply to the configuration.
5058
:type tags: MetricBulkTagConfigTagNameList, optional
5159
"""
5260
if emails is not unset:
5361
kwargs["emails"] = emails
62+
if exclude_tags_mode is not unset:
63+
kwargs["exclude_tags_mode"] = exclude_tags_mode
5464
if tags is not unset:
5565
kwargs["tags"] = tags
5666
super().__init__(kwargs)

src/datadog_api_client/v2/model/metric_bulk_tag_config_status_attributes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,22 @@ def openapi_types(_):
2626

2727
return {
2828
"emails": (MetricBulkTagConfigEmailList,),
29+
"exclude_tags_mode": (bool,),
2930
"status": (str,),
3031
"tags": (MetricBulkTagConfigTagNameList,),
3132
}
3233

3334
attribute_map = {
3435
"emails": "emails",
36+
"exclude_tags_mode": "exclude_tags_mode",
3537
"status": "status",
3638
"tags": "tags",
3739
}
3840

3941
def __init__(
4042
self_,
4143
emails: Union[MetricBulkTagConfigEmailList, UnsetType] = unset,
44+
exclude_tags_mode: Union[bool, UnsetType] = unset,
4245
status: Union[str, UnsetType] = unset,
4346
tags: Union[MetricBulkTagConfigTagNameList, UnsetType] = unset,
4447
**kwargs,
@@ -49,6 +52,10 @@ def __init__(
4952
:param emails: A list of account emails to notify when the configuration is applied.
5053
:type emails: MetricBulkTagConfigEmailList, optional
5154
55+
:param exclude_tags_mode: When set to true, the configuration will exclude the configured tags and include any other submitted tags.
56+
When set to false, the configuration will include the configured tags and exclude any other submitted tags.
57+
:type exclude_tags_mode: bool, optional
58+
5259
:param status: The status of the request.
5360
:type status: str, optional
5461
@@ -57,6 +64,8 @@ def __init__(
5764
"""
5865
if emails is not unset:
5966
kwargs["emails"] = emails
67+
if exclude_tags_mode is not unset:
68+
kwargs["exclude_tags_mode"] = exclude_tags_mode
6069
if status is not unset:
6170
kwargs["status"] = status
6271
if tags is not unset:

src/datadog_api_client/v2/model/metric_tag_configuration_attributes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def openapi_types(_):
2828
return {
2929
"aggregations": (MetricCustomAggregations,),
3030
"created_at": (datetime,),
31+
"exclude_tags_mode": (bool,),
3132
"include_percentiles": (bool,),
3233
"metric_type": (MetricTagConfigurationMetricTypes,),
3334
"modified_at": (datetime,),
@@ -37,6 +38,7 @@ def openapi_types(_):
3738
attribute_map = {
3839
"aggregations": "aggregations",
3940
"created_at": "created_at",
41+
"exclude_tags_mode": "exclude_tags_mode",
4042
"include_percentiles": "include_percentiles",
4143
"metric_type": "metric_type",
4244
"modified_at": "modified_at",
@@ -47,6 +49,7 @@ def __init__(
4749
self_,
4850
aggregations: Union[MetricCustomAggregations, UnsetType] = unset,
4951
created_at: Union[datetime, UnsetType] = unset,
52+
exclude_tags_mode: Union[bool, UnsetType] = unset,
5053
include_percentiles: Union[bool, UnsetType] = unset,
5154
metric_type: Union[MetricTagConfigurationMetricTypes, UnsetType] = unset,
5255
modified_at: Union[datetime, UnsetType] = unset,
@@ -77,6 +80,11 @@ def __init__(
7780
:param created_at: Timestamp when the tag configuration was created.
7881
:type created_at: datetime, optional
7982
83+
:param exclude_tags_mode: When set to true, the configuration will exclude the configured tags and include any other submitted tags.
84+
When set to false, the configuration will include the configured tags and exclude any other submitted tags.
85+
Defaults to false. Requires ``tags`` property.
86+
:type exclude_tags_mode: bool, optional
87+
8088
:param include_percentiles: Toggle to include or exclude percentile aggregations for distribution metrics.
8189
Only present when the ``metric_type`` is ``distribution``.
8290
:type include_percentiles: bool, optional
@@ -94,6 +102,8 @@ def __init__(
94102
kwargs["aggregations"] = aggregations
95103
if created_at is not unset:
96104
kwargs["created_at"] = created_at
105+
if exclude_tags_mode is not unset:
106+
kwargs["exclude_tags_mode"] = exclude_tags_mode
97107
if include_percentiles is not unset:
98108
kwargs["include_percentiles"] = include_percentiles
99109
if metric_type is not unset:

src/datadog_api_client/v2/model/metric_tag_configuration_create_attributes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ def openapi_types(_):
2626

2727
return {
2828
"aggregations": (MetricCustomAggregations,),
29+
"exclude_tags_mode": (bool,),
2930
"include_percentiles": (bool,),
3031
"metric_type": (MetricTagConfigurationMetricTypes,),
3132
"tags": ([str],),
3233
}
3334

3435
attribute_map = {
3536
"aggregations": "aggregations",
37+
"exclude_tags_mode": "exclude_tags_mode",
3638
"include_percentiles": "include_percentiles",
3739
"metric_type": "metric_type",
3840
"tags": "tags",
@@ -42,6 +44,7 @@ def __init__(
4244
self_,
4345
metric_type: MetricTagConfigurationMetricTypes,
4446
aggregations: Union[MetricCustomAggregations, UnsetType] = unset,
47+
exclude_tags_mode: Union[bool, UnsetType] = unset,
4548
include_percentiles: Union[bool, UnsetType] = unset,
4649
**kwargs,
4750
):
@@ -66,6 +69,11 @@ def __init__(
6669
Can only be applied to metrics that have a ``metric_type`` of ``count`` , ``rate`` , or ``gauge``.
6770
:type aggregations: MetricCustomAggregations, optional
6871
72+
:param exclude_tags_mode: When set to true, the configuration will exclude the configured tags and include any other submitted tags.
73+
When set to false, the configuration will include the configured tags and exclude any other submitted tags.
74+
Defaults to false. Requires ``tags`` property.
75+
:type exclude_tags_mode: bool, optional
76+
6977
:param include_percentiles: Toggle to include/exclude percentiles for a distribution metric.
7078
Defaults to false. Can only be applied to metrics that have a ``metric_type`` of ``distribution``.
7179
:type include_percentiles: bool, optional
@@ -78,6 +86,8 @@ def __init__(
7886
"""
7987
if aggregations is not unset:
8088
kwargs["aggregations"] = aggregations
89+
if exclude_tags_mode is not unset:
90+
kwargs["exclude_tags_mode"] = exclude_tags_mode
8191
if include_percentiles is not unset:
8292
kwargs["include_percentiles"] = include_percentiles
8393
super().__init__(kwargs)

0 commit comments

Comments
 (0)