mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 01:44:40 +02:00
service/gitea: add monitoring & dashboard
This commit is contained in:
parent
3569df7826
commit
9991dfaf47
3 changed files with 1292 additions and 1 deletions
|
@ -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";
|
||||
|
|
|
@ -54,4 +54,13 @@ in
|
|||
version = "5";
|
||||
hash = "sha256-9vfUGpypFNKm9T1F12Cqh8TIl0x3jSwv2fL9HVRLt3o=";
|
||||
};
|
||||
|
||||
gitea = (buildGrafanaDashboard {
|
||||
id = 13192;
|
||||
pname = "gitea";
|
||||
version = "1";
|
||||
hash = "sha256-IAaI/HvMxcWE3PGQFK8avNjgj88DgcDvkWRcDAWSejM=";
|
||||
}).overrideAttrs (self: super: {
|
||||
src = ./gitea.json; # sadly not yet updated to latest grafana
|
||||
});
|
||||
})
|
||||
|
|
1256
pkgs/grafana-dashboards/gitea.json
Normal file
1256
pkgs/grafana-dashboards/gitea.json
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue