mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 16:21:34 +01:00
grafana: Add victoriametrics dashboard
This commit is contained in:
parent
8a45686da7
commit
d7d28fa19f
3 changed files with 31 additions and 9 deletions
|
|
@ -62,7 +62,10 @@
|
||||||
victoriametrics.enable = true;
|
victoriametrics.enable = true;
|
||||||
victorialogs.enable = true;
|
victorialogs.enable = true;
|
||||||
};
|
};
|
||||||
dashboards.node-exporter-full.enable = true;
|
dashboards = {
|
||||||
|
nodeExporter.enable = true;
|
||||||
|
victoriametrics.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
victoriametrics = {
|
victoriametrics = {
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,10 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
dashboards.node-exporter-full.enable = lib.mkEnableOption "";
|
dashboards = {
|
||||||
|
nodeExporter.enable = lib.mkEnableOption "";
|
||||||
|
victoriametrics.enable = lib.mkEnableOption "";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
@ -117,12 +120,22 @@ in
|
||||||
++ (lib.optional cfg.datasources.victorialogs.enable victoriametrics-logs-datasource);
|
++ (lib.optional cfg.datasources.victorialogs.enable victoriametrics-logs-datasource);
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc."grafana-dashboards/node-exporter-full.json" = {
|
environment.etc = {
|
||||||
enable = cfg.dashboards.node-exporter-full.enable;
|
"grafana-dashboards/node-exporter-full.json" = {
|
||||||
source = pkgs.fetchurl {
|
enable = cfg.dashboards.nodeExporter.enable;
|
||||||
name = "node-exporter-full.json";
|
source = pkgs.fetchurl {
|
||||||
url = "https://grafana.com/api/dashboards/1860/revisions/41/download";
|
name = "node-exporter-full.json";
|
||||||
hash = "sha256-EywgxEayjwNIGDvSmA/S56Ld49qrTSbIYFpeEXBJlTs=";
|
url = "https://grafana.com/api/dashboards/1860/revisions/41/download";
|
||||||
|
hash = "sha256-EywgxEayjwNIGDvSmA/S56Ld49qrTSbIYFpeEXBJlTs=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"grafana-dashboards/victoriametrics-single-node.json" = {
|
||||||
|
enable = cfg.dashboards.victoriametrics.enable;
|
||||||
|
source = pkgs.fetchurl {
|
||||||
|
name = "victoriametrics-single-node.json";
|
||||||
|
url = "https://grafana.com/api/dashboards/10229/revisions/41/download";
|
||||||
|
hash = "sha256-mwtah8A2w81WZjf5bUXoTJfS1R9UX+tua2PiDrBKJCQ=";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,13 @@ in
|
||||||
|
|
||||||
services.victoriametrics = {
|
services.victoriametrics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs-unstable.victoriametrics;
|
# The victoriametrics grafana-dashboard expects the version label to have the format `victoria-metrics-*`
|
||||||
|
package = pkgs-unstable.victoriametrics.overrideAttrs (
|
||||||
|
_: previousAttrs: {
|
||||||
|
version = "victoria-metrics-" + previousAttrs.version;
|
||||||
|
__intentionallyOverridingVersion = true;
|
||||||
|
}
|
||||||
|
);
|
||||||
listenAddress = "localhost:${builtins.toString cfg.port}";
|
listenAddress = "localhost:${builtins.toString cfg.port}";
|
||||||
extraOptions = [ "-selfScrapeInterval=15s" ];
|
extraOptions = [ "-selfScrapeInterval=15s" ];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue