Skip to content

Commit 7dcf1dc

Browse files
authored
Deprecate extend queries feature (#811)
Mark the extend queries feature as deprecated in favor of recommending the sql_exporter. Signed-off-by: SuperQ <[email protected]>
1 parent 99828de commit 7dcf1dc

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ This will build the docker image as `prometheuscommunity/postgres_exporter:${bra
105105
* `auto-discover-databases`
106106
Whether to discover the databases on a server dynamically. Default is `false`.
107107

108-
* `extend.query-path`
108+
* `extend.query-path` (DEPRECATED)
109109
Path to a YAML file containing custom queries to run. Check out [`queries.yaml`](queries.yaml)
110110
for examples of the format.
111111

@@ -222,7 +222,9 @@ for l in StringIO(x):
222222
Adjust the value of the resultant prometheus value type appropriately. This helps build
223223
rich self-documenting metrics for the exporter.
224224

225-
### Adding new metrics via a config file
225+
### Adding new metrics via a config file (DEPRECATED)
226+
227+
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).
226228

227229
The -extend.query-path command-line argument specifies a YAML file containing additional queries to run.
228230
Some examples are provided in [queries.yaml](queries.yaml).

cmd/postgres_exporter/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var (
4444
disableDefaultMetrics = kingpin.Flag("disable-default-metrics", "Do not include default metrics.").Default("false").Envar("PG_EXPORTER_DISABLE_DEFAULT_METRICS").Bool()
4545
disableSettingsMetrics = kingpin.Flag("disable-settings-metrics", "Do not include pg_settings metrics.").Default("false").Envar("PG_EXPORTER_DISABLE_SETTINGS_METRICS").Bool()
4646
autoDiscoverDatabases = kingpin.Flag("auto-discover-databases", "Whether to discover the databases on a server dynamically.").Default("false").Envar("PG_EXPORTER_AUTO_DISCOVER_DATABASES").Bool()
47-
queriesPath = kingpin.Flag("extend.query-path", "Path to custom queries to run.").Default("").Envar("PG_EXPORTER_EXTEND_QUERY_PATH").String()
47+
queriesPath = kingpin.Flag("extend.query-path", "Path to custom queries to run. (DEPRECATED)").Default("").Envar("PG_EXPORTER_EXTEND_QUERY_PATH").String()
4848
onlyDumpMaps = kingpin.Flag("dumpmaps", "Do not run, simply dump the maps.").Bool()
4949
constantLabelsList = kingpin.Flag("constantLabels", "A list of label=value separated by comma(,).").Default("").Envar("PG_EXPORTER_CONSTANT_LABELS").String()
5050
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() {
9595
excludedDatabases := strings.Split(*excludeDatabases, ",")
9696
logger.Log("msg", "Excluded databases", "databases", fmt.Sprintf("%v", excludedDatabases))
9797

98+
if *queriesPath != "" {
99+
level.Warn(logger).Log("msg", "The extend queries.yaml config is DEPRECATD", "file", *queriesPath)
100+
}
101+
98102
opts := []ExporterOpt{
99103
DisableDefaultMetrics(*disableDefaultMetrics),
100104
DisableSettingsMetrics(*disableSettingsMetrics),

0 commit comments

Comments
 (0)