At some point in the past we find/replaced "this" to "cu" in the source code
and it's been like that ever since, including leaking into some of the metric
descriptions. Clean it up.
On advice from @SuperQ this is inline with the convention used in similar
exporters (example being the mysqld exporter). The full metric name is thus
`pg_up`.
Closes#135
When using queries.yaml, extra columns in the output would be detected as
unknown metrics (correctly) but the labels in the current mapping would not be
applied to the output.
This explains the rash of crashes due to inconsistent label cardinality. The
specific creation is when the name given to a column does not match the mapping
you intended, and so the metric shows up as unknown.
Closes#98
In PostgreSQL, views run as the defining user, meaning you don't
need a view wrapping a function (you can just have a view). This
improves readability, maintainability, performance, and clarity.
If the deployer role is not superuser (which is the case in AWS RDS,
for example), we need to grant it access to postgres_exporter role
before we can create a schema with AUTHORIZATION postgres_exporter.
Adds all bool/integer/real runtime variables that can be retrieved ths way.
Use the `pg_settings` view to retrieve runtime variables:
https://www.postgresql.org/docs/current/static/view-pg-settings.html
Replaces the use of `SHOW` to retrieve runtime variables.
Only runtime variables with a `vartype` of `bool`, `real`, or `integer`
are currently supported. Uses the `short_desc` field as a description.
This commit deprecates the following metric names:
```
pg_runtime_variable_max_connections
pg_runtime_variable_max_files_per_process
pg_runtime_variable_max_function_args
pg_runtime_variable_max_identifier_length
pg_runtime_variable_max_index_keys
pg_runtime_variable_max_locks_per_transaction
pg_runtime_variable_max_pred_locks_per_transaction
pg_runtime_variable_max_prepared_transactions
pg_runtime_variable_max_standby_archive_delay_milliseconds
pg_runtime_variable_max_standby_streaming_delay_milliseconds
pg_runtime_variable_max_wal_senders
```
They are replaced by equivalent names under `pg_settings` with the exception of
```
pg_runtime_variable_max_standby_archive_delay_milliseconds
pg_runtime_variable_max_standby_streaming_delay_milliseconds
```
which are replaced with
```
pg_settings_max_standby_archive_delay_seconds
pg_settings_max_standby_streaming_delay_seconds
```
Adds approximately 195 new metrics, when considered across all supported
PostgreSQL versions.
These scripts hold some learnings on how to compare changes to the metric
profile of the exporter. In future we'll teach travis to build this against
master automatically and post a comment back to a PR with what's been changed.
For now we just want to store them.