Skip to content

Commit

Permalink
Add metric_patterns options to filter all metric submission with a li…
Browse files Browse the repository at this point in the history
…st 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
  • Loading branch information
sarah-witt authored Mar 18, 2022
1 parent 1314a92 commit fa9492b
Show file tree
Hide file tree
Showing 526 changed files with 3,292 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def instance_host(field, value):
return '.'


def instance_metric_patterns(field, value):
return get_default_field_value(field, value)


def instance_metrics(field, value):
return get_default_field_value(field, value)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ class Config:
use_localized_counters: Optional[bool]


class MetricPatterns(BaseModel):
class Config:
allow_mutation = False

exclude: Optional[Sequence[str]]
include: Optional[Sequence[str]]


class Counter1(BaseModel):
class Config:
extra = Extra.allow
Expand Down Expand Up @@ -98,6 +106,7 @@ class Config:
enable_health_service_check: Optional[bool]
extra_metrics: Optional[Mapping[str, ExtraMetrics]]
host: Optional[str]
metric_patterns: Optional[MetricPatterns]
metrics: Optional[Mapping[str, Metrics]]
min_collection_interval: Optional[float]
namespace: Optional[str] = Field(None, regex='\\w*')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ instances:
#
# empty_default_hostname: false

## @param metric_patterns - mapping - optional
## A mapping of metrics to include or exclude, with each entry being a regular expression.
##
## Metrics defined in `exclude` will take precedence in case of overlap.
#
# metric_patterns:
# include:
# - <INCLUDE_REGEX>
# exclude:
# - <EXCLUDE_REGEX>

## Log Section
##
## type - required - Type of log input source (tcp / udp / file / windows_event)
Expand Down
2 changes: 1 addition & 1 deletion active_directory/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers = [
"Topic :: System :: Monitoring",
]
dependencies = [
"datadog-checks-base>=23.3.2",
"datadog-checks-base>=25.1.0",
]
dynamic = [
"version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ def instance_log_requests(field, value):
return False


def instance_metric_patterns(field, value):
return get_default_field_value(field, value)


def instance_min_collection_interval(field, value):
return 15

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ class Config:
writer: Optional[Mapping[str, Any]]


class MetricPatterns(BaseModel):
class Config:
allow_mutation = False

exclude: Optional[Sequence[str]]
include: Optional[Sequence[str]]


class Proxy(BaseModel):
class Config:
allow_mutation = False
Expand Down Expand Up @@ -62,6 +70,7 @@ class Config:
kerberos_keytab: Optional[str]
kerberos_principal: Optional[str]
log_requests: Optional[bool]
metric_patterns: Optional[MetricPatterns]
min_collection_interval: Optional[float]
ntlm_domain: Optional[str]
password: Optional[str]
Expand Down
11 changes: 11 additions & 0 deletions activemq_xml/datadog_checks/activemq_xml/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,17 @@ instances:
#
# empty_default_hostname: false

## @param metric_patterns - mapping - optional
## A mapping of metrics to include or exclude, with each entry being a regular expression.
##
## Metrics defined in `exclude` will take precedence in case of overlap.
#
# metric_patterns:
# include:
# - <INCLUDE_REGEX>
# exclude:
# - <EXCLUDE_REGEX>

## Log Section
##
## type - required - Type of log input source (tcp / udp / file / windows_event)
Expand Down
2 changes: 1 addition & 1 deletion activemq_xml/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers = [
"Topic :: System :: Monitoring",
]
dependencies = [
"datadog-checks-base>=24.0.0",
"datadog-checks-base>=25.1.0",
]
dynamic = [
"version",
Expand Down
4 changes: 4 additions & 0 deletions aerospike/datadog_checks/aerospike/config_models/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ def instance_host(field, value):
return 'localhost'


def instance_metric_patterns(field, value):
return get_default_field_value(field, value)


def instance_metrics(field, value):
return get_default_field_value(field, value)

Expand Down
9 changes: 9 additions & 0 deletions aerospike/datadog_checks/aerospike/config_models/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
from . import defaults, validators


class MetricPatterns(BaseModel):
class Config:
allow_mutation = False

exclude: Optional[Sequence[str]]
include: Optional[Sequence[str]]


class InstanceConfig(BaseModel):
class Config:
allow_mutation = False
Expand All @@ -28,6 +36,7 @@ class Config:
disable_generic_tags: Optional[bool]
empty_default_hostname: Optional[bool]
host: Optional[str]
metric_patterns: Optional[MetricPatterns]
metrics: Optional[Sequence[str]]
min_collection_interval: Optional[float]
namespace_metrics: Optional[Sequence[str]]
Expand Down
11 changes: 11 additions & 0 deletions aerospike/datadog_checks/aerospike/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@ instances:
#
# empty_default_hostname: false

## @param metric_patterns - mapping - optional
## A mapping of metrics to include or exclude, with each entry being a regular expression.
##
## Metrics defined in `exclude` will take precedence in case of overlap.
#
# metric_patterns:
# include:
# - <INCLUDE_REGEX>
# exclude:
# - <EXCLUDE_REGEX>

## Log Section
##
## type - required - Type of log input source (tcp / udp / file / windows_event)
Expand Down
2 changes: 1 addition & 1 deletion aerospike/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers = [
"Topic :: System :: Monitoring",
]
dependencies = [
"datadog-checks-base>=15.7.0",
"datadog-checks-base>=25.1.0",
]
dynamic = [
"version",
Expand Down
4 changes: 4 additions & 0 deletions airflow/datadog_checks/airflow/config_models/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ def instance_log_requests(field, value):
return False


def instance_metric_patterns(field, value):
return get_default_field_value(field, value)


def instance_min_collection_interval(field, value):
return 15

Expand Down
9 changes: 9 additions & 0 deletions airflow/datadog_checks/airflow/config_models/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ class Config:
writer: Optional[Mapping[str, Any]]


class MetricPatterns(BaseModel):
class Config:
allow_mutation = False

exclude: Optional[Sequence[str]]
include: Optional[Sequence[str]]


class Proxy(BaseModel):
class Config:
allow_mutation = False
Expand Down Expand Up @@ -59,6 +67,7 @@ class Config:
kerberos_keytab: Optional[str]
kerberos_principal: Optional[str]
log_requests: Optional[bool]
metric_patterns: Optional[MetricPatterns]
min_collection_interval: Optional[float]
ntlm_domain: Optional[str]
password: Optional[str]
Expand Down
11 changes: 11 additions & 0 deletions airflow/datadog_checks/airflow/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,17 @@ instances:
#
# empty_default_hostname: false

## @param metric_patterns - mapping - optional
## A mapping of metrics to include or exclude, with each entry being a regular expression.
##
## Metrics defined in `exclude` will take precedence in case of overlap.
#
# metric_patterns:
# include:
# - <INCLUDE_REGEX>
# exclude:
# - <EXCLUDE_REGEX>

## Log Section
##
## type - required - Type of log input source (tcp / udp / file / windows_event)
Expand Down
2 changes: 1 addition & 1 deletion airflow/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers = [
"Topic :: System :: Monitoring",
]
dependencies = [
"datadog-checks-base>=24.0.0",
"datadog-checks-base>=25.1.0",
]
dynamic = [
"version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ def instance_log_requests(field, value):
return False


def instance_metric_patterns(field, value):
return get_default_field_value(field, value)


def instance_metrics(field, value):
return get_default_field_value(field, value)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ class Config:
type: Optional[str]


class MetricPatterns(BaseModel):
class Config:
allow_mutation = False

exclude: Optional[Sequence[str]]
include: Optional[Sequence[str]]


class Metric(BaseModel):
class Config:
extra = Extra.allow
Expand Down Expand Up @@ -103,6 +111,7 @@ class Config:
kerberos_keytab: Optional[str]
kerberos_principal: Optional[str]
log_requests: Optional[bool]
metric_patterns: Optional[MetricPatterns]
metrics: Optional[Sequence[Union[str, Mapping[str, Union[str, Metric]]]]]
min_collection_interval: Optional[float]
namespace: Optional[str] = Field(None, regex='\\w*')
Expand Down
11 changes: 11 additions & 0 deletions amazon_msk/datadog_checks/amazon_msk/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -646,3 +646,14 @@ instances:
## This is useful for cluster-level checks.
#
# empty_default_hostname: false

## @param metric_patterns - mapping - optional
## A mapping of metrics to include or exclude, with each entry being a regular expression.
##
## Metrics defined in `exclude` will take precedence in case of overlap.
#
# metric_patterns:
# include:
# - <INCLUDE_REGEX>
# exclude:
# - <EXCLUDE_REGEX>
2 changes: 1 addition & 1 deletion amazon_msk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers = [
"Topic :: System :: Monitoring",
]
dependencies = [
"datadog-checks-base>=24.0.0",
"datadog-checks-base>=25.1.0",
]
dynamic = [
"version",
Expand Down
4 changes: 4 additions & 0 deletions ambari/datadog_checks/ambari/config_models/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ def instance_log_requests(field, value):
return False


def instance_metric_patterns(field, value):
return get_default_field_value(field, value)


def instance_min_collection_interval(field, value):
return 15

Expand Down
9 changes: 9 additions & 0 deletions ambari/datadog_checks/ambari/config_models/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ class Config:
writer: Optional[Mapping[str, Any]]


class MetricPatterns(BaseModel):
class Config:
allow_mutation = False

exclude: Optional[Sequence[str]]
include: Optional[Sequence[str]]


class Proxy(BaseModel):
class Config:
allow_mutation = False
Expand Down Expand Up @@ -59,6 +67,7 @@ class Config:
kerberos_keytab: Optional[str]
kerberos_principal: Optional[str]
log_requests: Optional[bool]
metric_patterns: Optional[MetricPatterns]
min_collection_interval: Optional[float]
ntlm_domain: Optional[str]
password: Optional[str]
Expand Down
11 changes: 11 additions & 0 deletions ambari/datadog_checks/ambari/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,17 @@ instances:
#
# empty_default_hostname: false

## @param metric_patterns - mapping - optional
## A mapping of metrics to include or exclude, with each entry being a regular expression.
##
## Metrics defined in `exclude` will take precedence in case of overlap.
#
# metric_patterns:
# include:
# - <INCLUDE_REGEX>
# exclude:
# - <EXCLUDE_REGEX>

## Log Section
##
## type - required - Type of log input source (tcp / udp / file / windows_event)
Expand Down
2 changes: 1 addition & 1 deletion ambari/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers = [
"Topic :: System :: Monitoring",
]
dependencies = [
"datadog-checks-base>=24.0.0",
"datadog-checks-base>=25.1.0",
]
dynamic = [
"version",
Expand Down
4 changes: 4 additions & 0 deletions apache/datadog_checks/apache/config_models/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ def instance_log_requests(field, value):
return False


def instance_metric_patterns(field, value):
return get_default_field_value(field, value)


def instance_min_collection_interval(field, value):
return 15

Expand Down
9 changes: 9 additions & 0 deletions apache/datadog_checks/apache/config_models/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ class Config:
writer: Optional[Mapping[str, Any]]


class MetricPatterns(BaseModel):
class Config:
allow_mutation = False

exclude: Optional[Sequence[str]]
include: Optional[Sequence[str]]


class Proxy(BaseModel):
class Config:
allow_mutation = False
Expand Down Expand Up @@ -60,6 +68,7 @@ class Config:
kerberos_keytab: Optional[str]
kerberos_principal: Optional[str]
log_requests: Optional[bool]
metric_patterns: Optional[MetricPatterns]
min_collection_interval: Optional[float]
ntlm_domain: Optional[str]
password: Optional[str]
Expand Down
Loading

0 comments on commit fa9492b

Please sign in to comment.