mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-02-05 20:28:54 -05:00
WIP: prometheus logging
This commit is contained in:
parent
229ce0ab43
commit
96c0a651dd
2 changed files with 36 additions and 28 deletions
|
|
@ -1,18 +1,39 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
#grafanaPort = lib.custom.autoport "grafana";
|
||||
grafanaPort = 3000;
|
||||
in
|
||||
{
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "prometheus";
|
||||
scrape_interval = "5s";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [
|
||||
"localhost:9090"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
services = {
|
||||
prometheus = {
|
||||
enable = true;
|
||||
globalConfig = {
|
||||
scrape_interval = "15s";
|
||||
evaluation_interval = "15s";
|
||||
};
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "prometheus";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "localhost:9090" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
#grafana = {
|
||||
# enable = true;
|
||||
# settings = {
|
||||
# server = {
|
||||
# http_addr = "0.0.0.0";
|
||||
# http_port = grafanaPort;
|
||||
# enable_gzip = true;
|
||||
# domain = "localhost";
|
||||
# };
|
||||
# analytics.reporting_enabled = false;
|
||||
# };
|
||||
#};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts."logs.wanderingcrow.net".extraConfig = ''
|
||||
reverse_proxy http://${builtins.toString config.services.grafana.settings.server.http_addr}:${builtins.toString config.services.grafana.settings.server.http_port}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue