Skip to content

Commit d8ddf7a

Browse files
sarah-wittfanny-jiang
authored andcommitted
Add metric_patterns options to filter all metric submission with a list of regexes (#11695)
* Add and sync models * revert ddev change * Bump dep * Update base version * Revert jmx changes * Revert jmx version changes, fix formatting * Fix parsing * Fix quote * Update test * Sync calico * Remove whitespace
1 parent 4afbd55 commit d8ddf7a

526 files changed

Lines changed: 3292 additions & 136 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

active_directory/datadog_checks/active_directory/config_models/defaults.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ def instance_host(field, value):
4646
return '.'
4747

4848

49+
def instance_metric_patterns(field, value):
50+
return get_default_field_value(field, value)
51+
52+
4953
def instance_metrics(field, value):
5054
return get_default_field_value(field, value)
5155

active_directory/datadog_checks/active_directory/config_models/instance.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ class Config:
5353
use_localized_counters: Optional[bool]
5454

5555

56+
class MetricPatterns(BaseModel):
57+
class Config:
58+
allow_mutation = False
59+
60+
exclude: Optional[Sequence[str]]
61+
include: Optional[Sequence[str]]
62+
63+
5664
class Counter1(BaseModel):
5765
class Config:
5866
extra = Extra.allow
@@ -98,6 +106,7 @@ class Config:
98106
enable_health_service_check: Optional[bool]
99107
extra_metrics: Optional[Mapping[str, ExtraMetrics]]
100108
host: Optional[str]
109+
metric_patterns: Optional[MetricPatterns]
101110
metrics: Optional[Mapping[str, Metrics]]
102111
min_collection_interval: Optional[float]
103112
namespace: Optional[str] = Field(None, regex='\\w*')

active_directory/datadog_checks/active_directory/data/conf.yaml.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,17 @@ instances:
149149
#
150150
# empty_default_hostname: false
151151

152+
## @param metric_patterns - mapping - optional
153+
## A mapping of metrics to include or exclude, with each entry being a regular expression.
154+
##
155+
## Metrics defined in `exclude` will take precedence in case of overlap.
156+
#
157+
# metric_patterns:
158+
# include:
159+
# - <INCLUDE_REGEX>
160+
# exclude:
161+
# - <EXCLUDE_REGEX>
162+
152163
## Log Section
153164
##
154165
## type - required - Type of log input source (tcp / udp / file / windows_event)

active_directory/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ classifiers = [
2929
"Topic :: System :: Monitoring",
3030
]
3131
dependencies = [
32-
"datadog-checks-base>=23.3.2",
32+
"datadog-checks-base>=25.1.0",
3333
]
3434
dynamic = [
3535
"version",

activemq_xml/datadog_checks/activemq_xml/config_models/defaults.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ def instance_log_requests(field, value):
114114
return False
115115

116116

117+
def instance_metric_patterns(field, value):
118+
return get_default_field_value(field, value)
119+
120+
117121
def instance_min_collection_interval(field, value):
118122
return 15
119123

activemq_xml/datadog_checks/activemq_xml/config_models/instance.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ class Config:
2727
writer: Optional[Mapping[str, Any]]
2828

2929

30+
class MetricPatterns(BaseModel):
31+
class Config:
32+
allow_mutation = False
33+
34+
exclude: Optional[Sequence[str]]
35+
include: Optional[Sequence[str]]
36+
37+
3038
class Proxy(BaseModel):
3139
class Config:
3240
allow_mutation = False
@@ -62,6 +70,7 @@ class Config:
6270
kerberos_keytab: Optional[str]
6371
kerberos_principal: Optional[str]
6472
log_requests: Optional[bool]
73+
metric_patterns: Optional[MetricPatterns]
6574
min_collection_interval: Optional[float]
6675
ntlm_domain: Optional[str]
6776
password: Optional[str]

activemq_xml/datadog_checks/activemq_xml/data/conf.yaml.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,17 @@ instances:
408408
#
409409
# empty_default_hostname: false
410410

411+
## @param metric_patterns - mapping - optional
412+
## A mapping of metrics to include or exclude, with each entry being a regular expression.
413+
##
414+
## Metrics defined in `exclude` will take precedence in case of overlap.
415+
#
416+
# metric_patterns:
417+
# include:
418+
# - <INCLUDE_REGEX>
419+
# exclude:
420+
# - <EXCLUDE_REGEX>
421+
411422
## Log Section
412423
##
413424
## type - required - Type of log input source (tcp / udp / file / windows_event)

activemq_xml/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ classifiers = [
2929
"Topic :: System :: Monitoring",
3030
]
3131
dependencies = [
32-
"datadog-checks-base>=24.0.0",
32+
"datadog-checks-base>=25.1.0",
3333
]
3434
dynamic = [
3535
"version",

aerospike/datadog_checks/aerospike/config_models/defaults.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ def instance_host(field, value):
3838
return 'localhost'
3939

4040

41+
def instance_metric_patterns(field, value):
42+
return get_default_field_value(field, value)
43+
44+
4145
def instance_metrics(field, value):
4246
return get_default_field_value(field, value)
4347

aerospike/datadog_checks/aerospike/config_models/instance.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
from . import defaults, validators
2020

2121

22+
class MetricPatterns(BaseModel):
23+
class Config:
24+
allow_mutation = False
25+
26+
exclude: Optional[Sequence[str]]
27+
include: Optional[Sequence[str]]
28+
29+
2230
class InstanceConfig(BaseModel):
2331
class Config:
2432
allow_mutation = False
@@ -28,6 +36,7 @@ class Config:
2836
disable_generic_tags: Optional[bool]
2937
empty_default_hostname: Optional[bool]
3038
host: Optional[str]
39+
metric_patterns: Optional[MetricPatterns]
3140
metrics: Optional[Sequence[str]]
3241
min_collection_interval: Optional[float]
3342
namespace_metrics: Optional[Sequence[str]]

0 commit comments

Comments
 (0)