mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-11 03:31:26 +00:00
Deprecate extend queries feature (#811)
Mark the extend queries feature as deprecated in favor of recommending the sql_exporter. Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
parent
99828de70a
commit
7dcf1dc7b6
@ -105,7 +105,7 @@ This will build the docker image as `prometheuscommunity/postgres_exporter:${bra
|
|||||||
* `auto-discover-databases`
|
* `auto-discover-databases`
|
||||||
Whether to discover the databases on a server dynamically. Default is `false`.
|
Whether to discover the databases on a server dynamically. Default is `false`.
|
||||||
|
|
||||||
* `extend.query-path`
|
* `extend.query-path` (DEPRECATED)
|
||||||
Path to a YAML file containing custom queries to run. Check out [`queries.yaml`](queries.yaml)
|
Path to a YAML file containing custom queries to run. Check out [`queries.yaml`](queries.yaml)
|
||||||
for examples of the format.
|
for examples of the format.
|
||||||
|
|
||||||
@ -222,7 +222,9 @@ for l in StringIO(x):
|
|||||||
Adjust the value of the resultant prometheus value type appropriately. This helps build
|
Adjust the value of the resultant prometheus value type appropriately. This helps build
|
||||||
rich self-documenting metrics for the exporter.
|
rich self-documenting metrics for the exporter.
|
||||||
|
|
||||||
### Adding new metrics via a config file
|
### Adding new metrics via a config file (DEPRECATED)
|
||||||
|
|
||||||
|
This feature is deprecated in favor of built-in collector functions. For generic SQL database monitoring see the [sql_exporter](https://github.com/burningalchemist/sql_exporter).
|
||||||
|
|
||||||
The -extend.query-path command-line argument specifies a YAML file containing additional queries to run.
|
The -extend.query-path command-line argument specifies a YAML file containing additional queries to run.
|
||||||
Some examples are provided in [queries.yaml](queries.yaml).
|
Some examples are provided in [queries.yaml](queries.yaml).
|
||||||
|
@ -44,7 +44,7 @@ var (
|
|||||||
disableDefaultMetrics = kingpin.Flag("disable-default-metrics", "Do not include default metrics.").Default("false").Envar("PG_EXPORTER_DISABLE_DEFAULT_METRICS").Bool()
|
disableDefaultMetrics = kingpin.Flag("disable-default-metrics", "Do not include default metrics.").Default("false").Envar("PG_EXPORTER_DISABLE_DEFAULT_METRICS").Bool()
|
||||||
disableSettingsMetrics = kingpin.Flag("disable-settings-metrics", "Do not include pg_settings metrics.").Default("false").Envar("PG_EXPORTER_DISABLE_SETTINGS_METRICS").Bool()
|
disableSettingsMetrics = kingpin.Flag("disable-settings-metrics", "Do not include pg_settings metrics.").Default("false").Envar("PG_EXPORTER_DISABLE_SETTINGS_METRICS").Bool()
|
||||||
autoDiscoverDatabases = kingpin.Flag("auto-discover-databases", "Whether to discover the databases on a server dynamically.").Default("false").Envar("PG_EXPORTER_AUTO_DISCOVER_DATABASES").Bool()
|
autoDiscoverDatabases = kingpin.Flag("auto-discover-databases", "Whether to discover the databases on a server dynamically.").Default("false").Envar("PG_EXPORTER_AUTO_DISCOVER_DATABASES").Bool()
|
||||||
queriesPath = kingpin.Flag("extend.query-path", "Path to custom queries to run.").Default("").Envar("PG_EXPORTER_EXTEND_QUERY_PATH").String()
|
queriesPath = kingpin.Flag("extend.query-path", "Path to custom queries to run. (DEPRECATED)").Default("").Envar("PG_EXPORTER_EXTEND_QUERY_PATH").String()
|
||||||
onlyDumpMaps = kingpin.Flag("dumpmaps", "Do not run, simply dump the maps.").Bool()
|
onlyDumpMaps = kingpin.Flag("dumpmaps", "Do not run, simply dump the maps.").Bool()
|
||||||
constantLabelsList = kingpin.Flag("constantLabels", "A list of label=value separated by comma(,).").Default("").Envar("PG_EXPORTER_CONSTANT_LABELS").String()
|
constantLabelsList = kingpin.Flag("constantLabels", "A list of label=value separated by comma(,).").Default("").Envar("PG_EXPORTER_CONSTANT_LABELS").String()
|
||||||
excludeDatabases = kingpin.Flag("exclude-databases", "A list of databases to remove when autoDiscoverDatabases is enabled").Default("").Envar("PG_EXPORTER_EXCLUDE_DATABASES").String()
|
excludeDatabases = kingpin.Flag("exclude-databases", "A list of databases to remove when autoDiscoverDatabases is enabled").Default("").Envar("PG_EXPORTER_EXCLUDE_DATABASES").String()
|
||||||
@ -95,6 +95,10 @@ func main() {
|
|||||||
excludedDatabases := strings.Split(*excludeDatabases, ",")
|
excludedDatabases := strings.Split(*excludeDatabases, ",")
|
||||||
logger.Log("msg", "Excluded databases", "databases", fmt.Sprintf("%v", excludedDatabases))
|
logger.Log("msg", "Excluded databases", "databases", fmt.Sprintf("%v", excludedDatabases))
|
||||||
|
|
||||||
|
if *queriesPath != "" {
|
||||||
|
level.Warn(logger).Log("msg", "The extend queries.yaml config is DEPRECATD", "file", *queriesPath)
|
||||||
|
}
|
||||||
|
|
||||||
opts := []ExporterOpt{
|
opts := []ExporterOpt{
|
||||||
DisableDefaultMetrics(*disableDefaultMetrics),
|
DisableDefaultMetrics(*disableDefaultMetrics),
|
||||||
DisableSettingsMetrics(*disableSettingsMetrics),
|
DisableSettingsMetrics(*disableSettingsMetrics),
|
||||||
|
Loading…
Reference in New Issue
Block a user