service/gitea: add monitoring & dashboard

This commit is contained in:
Felix Buehler 2023-04-16 16:22:35 +02:00
parent 3569df7826
commit 9991dfaf47
3 changed files with 1292 additions and 1 deletions

View file

@ -1,5 +1,5 @@
# self-hosted git service
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.gitea;
domain = config.networking.domain;
@ -25,6 +25,7 @@ in
service.DISABLE_REGISTRATION = true;
ui.DEFAULT_THEME = "arc-green";
log.LEVEL = "Warn";
metrics.ENABLED = config.services.prometheus.enable;
};
lfs.enable = true;
};
@ -44,6 +45,31 @@ in
];
};
services.prometheus = {
scrapeConfigs = [
{
job_name = "gitea";
static_configs = [
{
targets = [ "127.0.0.1:${toString cfg.port}" ];
labels = {
instance = config.networking.hostName;
};
}
];
}
];
};
services.grafana.provision = {
dashboards.settings.providers = [
{
name = "Gitea";
options.path = pkgs.grafana-dashboards.gitea;
disableDeletion = true;
}
];
};
webapps.apps.gitea = {
dashboard = {
name = "Code";