fix: deprecate useless database config option (#11044)

This commit is contained in:
Joshua Powers 2022-05-10 15:26:04 -06:00 committed by GitHub
parent 3e60bc1d4b
commit 7d456d1773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 18 deletions

View File

@ -188,6 +188,7 @@ func makeRequestBodyReader(contentEncoding, body string) (io.ReadCloser, error)
} }
return rc, nil return rc, nil
} }
return io.NopCloser(reader), nil return io.NopCloser(reader), nil
} }

View File

@ -28,8 +28,9 @@ The example below has two queries are specified, with the following parameters:
# to grab metrics for. # to grab metrics for.
# #
address = "host=localhost user=postgres sslmode=disable" address = "host=localhost user=postgres sslmode=disable"
# A list of databases to pull metrics about. If not specified, metrics for all
# databases are gathered. ## A list of databases to pull metrics about.
## deprecated in 1.22.3; use the sqlquery option to specify database to use
# databases = ["app_production", "testing"] # databases = ["app_production", "testing"]
## Whether to use prepared statements when connecting to the database. ## Whether to use prepared statements when connecting to the database.
@ -38,20 +39,6 @@ The example below has two queries are specified, with the following parameters:
prepared_statements = true prepared_statements = true
# Define the toml config where the sql queries are stored # Define the toml config where the sql queries are stored
# New queries can be added, if the withdbname is set to true and there is no
# databases defined in the 'databases field', the sql query is ended by a 'is
# not null' in order to make the query succeed.
# Be careful that the sqlquery must contain the where clause with a part of
# the filtering, the plugin will add a 'IN (dbname list)' clause if the
# withdbname is set to true
# Example :
# The sqlquery : "SELECT * FROM pg_stat_database where datname" become
# "SELECT * FROM pg_stat_database where datname IN ('postgres', 'pgbench')"
# because the databases variable was set to ['postgres', 'pgbench' ] and the
# withdbname was true.
# Be careful that if the withdbname is set to false you don't have to define
# the where clause (aka with the dbname)
#
# The script option can be used to specify the .sql file path. # The script option can be used to specify the .sql file path.
# If script and sqlquery options specified at same time, sqlquery will be used # If script and sqlquery options specified at same time, sqlquery will be used
# #

View File

@ -18,7 +18,7 @@ import (
type Postgresql struct { type Postgresql struct {
postgresql.Service postgresql.Service
Databases []string Databases []string `deprecated:"1.22.4;use the sqlquery option to specify database to use"`
AdditionalTags []string AdditionalTags []string
Timestamp string Timestamp string
Query query Query query
@ -32,7 +32,7 @@ type query []struct {
Sqlquery string Sqlquery string
Script string Script string
Version int Version int
Withdbname bool Withdbname bool `deprecated:"1.22.4;use the sqlquery option to specify database to use"`
Tagvalue string Tagvalue string
Measurement string Measurement string
Timestamp string Timestamp string