setup grafana db
This commit is contained in:
parent
5d70cf127d
commit
f35facbcef
7 changed files with 63 additions and 27 deletions
48
hosts/monitoring/grafana.nix
Normal file
48
hosts/monitoring/grafana.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{ config, ... }:
|
||||
|
||||
# Dashboards:
|
||||
# - Synapse: https://github.com/element-hq/synapse/tree/master/contrib/grafana
|
||||
|
||||
{
|
||||
services = {
|
||||
grafana = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server.http_addr = "::1";
|
||||
database = {
|
||||
type = "postgres";
|
||||
name = "grafana";
|
||||
user = "grafana";
|
||||
host = "sql.berlin.ccc.de:5432";
|
||||
password = "$__file{${config.age.secrets.postgres-grafana.path}}";
|
||||
};
|
||||
security = {
|
||||
secret_key = "$__file{${config.age.secrets.grafana_secret_key.path}}";
|
||||
admin_user = "xengi";
|
||||
admin_password = "$__file{${config.age.secrets.grafana_admin_password.path}}";
|
||||
admin_email = "cccb-grafana@xengi.de";
|
||||
};
|
||||
analytics = {
|
||||
reporting_enabled = false;
|
||||
feedback_links_enabled = false;
|
||||
};
|
||||
};
|
||||
provision = {
|
||||
enable = true;
|
||||
datasources.settings.datasources = [
|
||||
{
|
||||
name = "Prometheus";
|
||||
type = "prometheus";
|
||||
url = "http://${config.services.prometheus.listenAddress}:${toString config.services.prometheus.port}";
|
||||
jsonData = {
|
||||
httpMethod = "GET";
|
||||
prometheusType = "Prometheus";
|
||||
cacheLevel = "High";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue