Skip to content

Commit

Permalink
fix: deprecate useless database config option (influxdata#11044)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7d456d1)
  • Loading branch information
powersj authored and Sebastian Spaink committed Jun 7, 2022
1 parent acf6706 commit 95bd648
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
1 change: 1 addition & 0 deletions plugins/inputs/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ func makeRequestBodyReader(contentEncoding, body string) (io.ReadCloser, error)
}
return rc, nil
}

return io.NopCloser(reader), nil
}

Expand Down
19 changes: 3 additions & 16 deletions plugins/inputs/postgresql_extensible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ The example below has two queries are specified, with the following parameters:
# to grab metrics for.
#
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"]

## Whether to use prepared statements when connecting to the database.
Expand All @@ -35,20 +36,6 @@ The example below has two queries are specified, with the following parameters:
prepared_statements = true

# 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.
# If script and sqlquery options specified at same time, sqlquery will be used
#
Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/postgresql_extensible/postgresql_extensible.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

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

0 comments on commit 95bd648

Please sign in to comment.