-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #224 from sethcleveland/Support_generic_postgres_c…
…ustom_metrics Support generic postgres custom metrics
- Loading branch information
Showing
4 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## | ||
# The postgres_custom_metric defines a custom sql metric. | ||
# https://help.datadoghq.com/hc/en-us/articles/208385813-Postgres-custom-metric-collection-explained | ||
# | ||
# $query: | ||
# The custom metric SQL query. It must contain a '%s' for defining the metrics. | ||
# | ||
# $metrics: | ||
# a hash of column name to metric definition. a metric definition is an array | ||
# consisting of two columns -- the datadog metric name and the metric type. | ||
# | ||
# $relation: | ||
# ? | ||
# | ||
# $descriptor: | ||
# an array that maps an sql column's to a tag. Each descriptor consists of two | ||
# fields -- column name, and datadog tag. | ||
define datadog_agent::integrations::postgres_custom_metric( | ||
$query, | ||
$metrics, | ||
$relation = false, | ||
$descriptors = [], | ||
) { | ||
validate_re($query, '^.*%s.*$', 'custom_metrics require %s for metric substitution') | ||
validate_hash($metrics) | ||
validate_array($descriptors) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters