Skip to content

Commit

Permalink
Setup data source URI so that remote postgres can be monitored
Browse files Browse the repository at this point in the history
  • Loading branch information
danivovich committed Mar 23, 2018
1 parent 8401c13 commit cc84fe3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Set up common prometheus exporter configurations
```
- src: [email protected]:smartlogic/ansible-role-prometheus-exporters
name: prometheus-exporters
version: 0.5.1
version: 0.5.2
```

## Requirements
Expand Down Expand Up @@ -65,6 +65,9 @@ These ports should be opened to the prometheus server based on the enabled expor
- Default: `disable` - because the default is socket connection
- `postgres_exporter_connection_user` -
- Default: `prometheus` - the connecting user (uses identity be default)
- `postgres_exporter_data_source_uri` - use URI style with username and password ommited, used in place of the previous options
- `postgres_exporter_data_source_user` - use with URI style to specify the user
- `postgres_exporter_data_source_pass` - use with URI style to specify the password
- `blackbox_exporter_version` - Which version of blackbox_exporter to download
- `blackbox_exporter_checksum` - The checksum for the version of blackbox_exporter
- `statsd_exporter_version` - Which version of statsd_exporter to download
Expand Down
6 changes: 6 additions & 0 deletions templates/postgres_exporter.env.j2
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
{% if postgres_exporter_data_source_uri %}
DATA_SOURCE_URI={{ postgres_exporter_data_source_uri }}
DATA_SOURCE_USER={{ postgres_exporter_data_source_user }}
DATA_SOURCE_PASS={{ postgres_exporter_data_source_pass }}
{% else %}
DATA_SOURCE_NAME="user={{ postgres_exporter_connection_user }} dbname={{ postgres_exporter_connection_dbname }} host={{ postgres_exporter_connection_host }} sslmode={{ postgres_exporter_connection_ssl_mode }}"
{% endif %}

0 comments on commit cc84fe3

Please sign in to comment.