33Service to extract and provide metrics on your PostgreSQL database.
44
55This tool is a CLI (command line) tool that can be called to extract
6- statistics and create metrics regarding your PostgreSQL database cluster.
6+ statistics and create metrics from your PostgreSQL database cluster.
77CLI is runnable in long running process mode, which will periodically
88send the gathered metrics forward.
99
@@ -12,10 +12,10 @@ compatible JSON, which is created by a set of functions listed in
1212the configuration file.
1313
1414The extracted metrics can be printed out as direct output of
15- the CLI tool or sent out of the host, where the postgresql-metrics
16- process is running using [ FFWD] ( https://github.com/spotify/ffwd ) .
15+ the CLI tool, or sent out of the host the postgresql-metrics
16+ process is running in using [ FFWD] ( https://github.com/spotify/ffwd ) .
1717
18- Notice that the [ FFWD] ( https://github.com/spotify/ffwd ) format is
18+ The [ FFWD] ( https://github.com/spotify/ffwd ) format is
1919plain JSON sent over a UDP socket, so you can use whatever
2020UDP socket endpoint, which understands JSON, to consume the metrics.
2121
@@ -30,28 +30,26 @@ technologies.
3030
3131* Python 2.7
3232* PostgreSQL 9.3 or later
33- * Debian based distribution with Upstart or systemd, if you want to use the packaging functionality
33+ * Debian based distribution with systemd ( packaging requirement only)
3434
3535
3636## Building and Installing
3737
38- You can build a Debian package out of this by calling * debuild* in project
39- root, e.g.:
38+ You can build a Debian package by running the following in project root:
4039
4140```
42- debuild -us -uc -b
41+ dpkg-buildpackage -us -uc -b
4342```
4443
45- Notice that postgresql-metrics includes by default an Upstart script or systemd
46- service to run as long running process, pushing metrics to FFWD as gathered.
44+ Notice that postgresql-metrics includes by default a systemd service to
45+ run as long running process, pushing metrics to FFWD as gathered.
4746You need to stop the long running process after installing the package for configuration.
4847
4948```
50- sudo stop postgresql-metrics
49+ sudo systemctl stop postgresql-metrics
5150```
5251
53- Notice that by default Upstart processes log under * /var/log/upstart/* , if you
54- want to debug the process. For the systemd service, you can run
52+ If you want to debug the process. For the systemd service, you can run
5553* sudo journalctl -u postgresql-metrics* to see the service's log.
5654
5755### Edit Configuration
@@ -67,8 +65,8 @@ keep using a single configuration file.
6765
6866Edit at least the values under * postgres* section in the configuration to
6967match your PostgreSQL cluster setup. Remember also to list the * databases*
70- you want to gather metrics from. Notice that by database in this context
71- we mean a database name you created within your PostgreSQL cluster.
68+ you want to gather metrics from. By database in this context we mean
69+ a database name you created within your PostgreSQL cluster.
7270
7371### Prepare Database
7472
@@ -80,7 +78,7 @@ The configured metrics user will be also granted access to the created
8078statistics functions and views.
8179
8280You need to provide administrator user to the * prepare-db* call, which
83- the tool is kind enough to ask. You don't need to provide credentials, if
81+ the tool is kind enough to ask. You don't need to provide credentials if
8482you are running the * prepare-db* with a local user that is configured to be
8583trusted locally by the PostgreSQL cluster (in * pg_hba.conf* ), and is
8684a super user, like the default * postgres* user created by some distribution
@@ -103,10 +101,10 @@ Add one line per database you are monitoring into the end of the *pg_hba.conf*
103101file for your cluster:
104102
105103```
106- host my_database_name metrics_user_name 127.0.0.1/32 md5 # metrics user access
104+ host my_database_name postgresql_metrics_user 127.0.0.1/32 md5 # metrics user access
107105```
108106
109- Replace the * my_database_name* and * metrics_user_name * with the values you
107+ Replace the * my_database_name* and * postgresql_metrics_user * with the values you
110108configured into the postgresql-metrics configuration in ** Edit Configuration**
111109step above.
112110
@@ -127,13 +125,7 @@ You need to call the command above as a user that has access to the WAL log
127125directory under PostgreSQL, or the metric gathering WAL file amounts will fail.
128126Single failed metric calls will not prevent the rest of gathering process.
129127
130- You can also start the long running process again, if using Upstart:
131-
132- ```
133- sudo start postgresql-metrics
134- ```
135-
136- Likewise, if using systemd:
128+ You can also start the long running process again, if using systemd:
137129
138130```
139131sudo systemctl start postgresql-metrics
@@ -144,15 +136,14 @@ sudo systemctl start postgresql-metrics
144136This section explains the metrics we gather using this tool.
145137
146138Notice that there are many system specific metrics that you should gather
147- in addition to the Postgres specific metrics. These kind of metrics we do
148- not gather, that you should gather with other tools, are for example:
139+ in addition to the Postgres specific metrics, for example:
149140
150141* CPU usage
151142* Network usage, sent / received bytes per related network interface
143+ * Memory usage
152144* Disk I/O operations
153145* I/O await times
154- * Disk usage amounts and free space left
155- * Memory usage
146+ * Disk usage and free space left
156147
157148
158149### Database Specific Metrics
0 commit comments