File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444 $password,
4545 $tags = [],
4646 $tables = [],
47- $custom_metrics = [] ,
47+ $custom_metrics = {} ,
4848) inherits datadog_agent::params {
4949 include datadog_agent
5050
5151 validate_array($tags )
5252 validate_array($tables )
53- validate_array($custom_metrics )
5453
5554 file { "${datadog_agent::params::conf_dir}/postgres.yaml" :
5655 ensure => file ,
6160 require => Package[$datadog_agent::params::package_name ],
6261 notify => Service[$datadog_agent::params::service_name ],
6362 }
63+
64+ create_resources(" datadog_agent::integrations::postgres_custom_metric" , $custom_metrics )
6465}
Original file line number Diff line number Diff line change 1+ # #
2+ # The postgres_custom_metric defines a custom sql metric.
3+ # https://help.datadoghq.com/hc/en-us/articles/208385813-Postgres-custom-metric-collection-explained
4+ #
5+ # $query:
6+ # The custom metric SQL query. It must contain a '%s' for defining the metrics.
7+ #
8+ # $metrics:
9+ # a hash of column name to metric definition. a metric definition is an array
10+ # consisting of two columns -- the datadog metric name and the metric type.
11+ #
12+ # $relation:
13+ # ?
14+ #
15+ # $descriptor:
16+ # an array that maps an sql column's to a tag. Each descriptor consists of two
17+ # fields -- column name, and datadog tag.
18+ define datadog_agent::integrations::postgres_custom_metric (
19+ $query ,
20+ $metrics ,
21+ $relation = false ,
22+ $descriptors = [],
23+ ) {
24+ validate_re($query , ' ^.*%s.*$' )
25+ validate_hash($metrics )
26+ validate_array($descriptors )
27+ }
You can’t perform that action at this time.
0 commit comments