Skip to content

Commit 2e16080

Browse files
authored
doc: how to export node and postgres sans grafana
1 parent b5d8444 commit 2e16080

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

docs/configuring-playbook-prometheus-grafana.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,34 @@ Name | Description
5656
`matrix_nginx_proxy_proxy_synapse_metrics`|Set this to `true` to make matrix-nginx-proxy expose the Synapse metrics at `https://matrix.DOMAIN/_synapse/metrics`
5757
`matrix_nginx_proxy_proxy_synapse_metrics_basic_auth_enabled`|Set this to `true` to password-protect (using HTTP Basic Auth) `https://matrix.DOMAIN/_synapse/metrics` (the username is always `prometheus`, the password is defined in `matrix_nginx_proxy_proxy_synapse_metrics_basic_auth_key`)
5858
`matrix_nginx_proxy_proxy_synapse_metrics_basic_auth_key`|Set this to a password to use for HTTP Basic Auth for protecting `https://matrix.DOMAIN/_synapse/metrics` (the username is always `prometheus` - it's not configurable)
59-
`matrix_server_fqn_grafana`|Use this variable to override the domain at which the Grafana web user-interface is at (defaults to `stats.DOMAIN`).
59+
`matrix_server_fqn_grafana`|Use this variable to override the domain at which the Grafana web user-interface is at (defaults to `stats.DOMAIN`)
6060

61+
It is further possible to also run and export metrics from node-exporter and postgres-exporter without installing Prometheus and Grafana. It is possible to use `matrix_prometheus_node_exporter_container_http_host_bind_port` etc., but not always the best choice, for example because your server is on a public network. Use the following variables additionally to the ones mentioned above:
62+
63+
Name | Description
64+
-----|----------
65+
`matrix_nginx_proxy_proxy_grafana_enabled`|Set this to `true` to make the stats subdomain (`matrix_server_fqn_grafana`) available via the Nginx proxy
66+
`matrix_ssl_additional_domains_to_obtain_certificates_for`|Add `"{{ matrix_server_fqn_grafana }}"` to this list to have letsencrypt fetch a certificate for the stats subdomain
67+
`matrix_prometheus_node_exporter_enabled`|Set this to `true` to enable the node (general system stats) exporter
68+
`matrix_prometheus_postgres_exporter_enabled`|Set this to `true` to enable the Postgres exporter
69+
`matrix_nginx_proxy_proxy_grafana_additional_server_configuration_blocks`|Add locations to this list depending on which of the above exporters you enabled (see below)
70+
71+
```nginx
72+
matrix_nginx_proxy_proxy_grafana_additional_server_configuration_blocks:
73+
- 'location /node-exporter/ {
74+
resolver 127.0.0.11 valid=5s;
75+
proxy_pass http://matrix-prometheus-node-exporter:9100/;
76+
auth_basic "protected";
77+
auth_basic_user_file /nginx-data/matrix-synapse-metrics-htpasswd;
78+
}'
79+
- 'location /postgres-exporter/ {
80+
resolver 127.0.0.11 valid=5s;
81+
proxy_pass http://matrix-prometheus-postgres-exporter:9187/;
82+
auth_basic "protected";
83+
auth_basic_user_file /nginx-data/matrix-synapse-metrics-htpasswd;
84+
}'
85+
```
86+
You can customize the `location`s to your liking, just point your Prometheus to there later (e.g. `stats.DOMAIN/node-exporter/metrics`). Nginx is very picky about the `proxy_pass`syntax: take care to follow the example closely and note the trailing slash as well as absent use of variables. postgres-exporter uses the nonstandard port 9187.
6187

6288
## More information
6389

0 commit comments

Comments
 (0)