Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deprecate useless database config option #11044

Merged
merged 3 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/inputs/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,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 @@ -28,8 +28,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 @@ -38,20 +39,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
powersj marked this conversation as resolved.
Show resolved Hide resolved
# 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