-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs in PostgreSQL modules about recommended configuration (#24588)
- Loading branch information
Showing
7 changed files
with
208 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
metricbeat/module/postgresql/statement/_meta/docs.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,41 @@ | ||
This is the `statement` metricset of the PostgreSQL module. | ||
|
||
This module collects information from the `pg_stat_statements` view, that keeps | ||
track of planning and execution statistics of all SQL statements executed by | ||
the server. | ||
|
||
`pg_stat_statements` is included by an additional module in PostgreSQL. This | ||
module requires additional shared memory, and is disabled by default. | ||
|
||
You can enable it by adding this module to the configuration as a shared | ||
preloaded library. | ||
|
||
["source"] | ||
------------------------------------------- | ||
shared_preload_libraries = 'pg_stat_statements' | ||
pg_stat_statements.max = 10000 | ||
pg_stat_statements.track = all | ||
------------------------------------------- | ||
|
||
NOTE: Preloading this library in your server will increase the memory usage of | ||
your PostgreSQL server. Use it with care. | ||
|
||
Once the server is started with this module, it starts collecting statistics | ||
about all statements executed. To make these statistics available in the | ||
`pg_stat_statements` view, the following statement needs to be executed in the | ||
server: | ||
|
||
["source","sql"] | ||
------------------------------------------- | ||
CREATE EXTENSION pg_stat_statements; | ||
------------------------------------------- | ||
|
||
You can read more about the available options for this module in the | ||
https://www.postgresql.org/docs/13/pgstatstatements.html[official documentation]. | ||
|
||
NOTE: The PostgreSQL module of Filebeat is also able to collect information | ||
about statements executed in the server from its logs. You may chose which one | ||
is better for your needings. An important difference is that the Metricbeat | ||
module collects aggregated information when the statement is executed several | ||
times, but cannot know when each statement was executed. This information can be | ||
obtained from logs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters