prometheus-fastly-exporter: init at v6.1.0

authored by Souvik Sen and committed by Souvik Sen 2f669293 9df2cb07

+65
+1
nixos/modules/services/monitoring/prometheus/exporters.nix
··· 32 "dnsmasq" 33 "domain" 34 "dovecot" 35 "fritzbox" 36 "influxdb" 37 "json"
··· 32 "dnsmasq" 33 "domain" 34 "dovecot" 35 + "fastly" 36 "fritzbox" 37 "influxdb" 38 "json"
+41
nixos/modules/services/monitoring/prometheus/exporters/fastly.nix
···
··· 1 + { config, lib, pkgs, options }: 2 + 3 + with lib; 4 + 5 + let cfg = config.services.prometheus.exporters.fastly; 6 + in 7 + { 8 + port = 9118; 9 + extraOpts = { 10 + debug = mkEnableOption "Debug logging mode for fastly-exporter"; 11 + 12 + configFile = mkOption { 13 + type = types.nullOr types.path; 14 + default = null; 15 + description = '' 16 + Path to a fastly-exporter configuration file. 17 + Example one can be generated with <literal>fastly-exporter --config-file-example</literal>. 18 + ''; 19 + example = "./fastly-exporter-config.txt"; 20 + }; 21 + 22 + tokenPath = mkOption { 23 + type = types.nullOr types.path; 24 + apply = final: if final == null then null else toString final; 25 + description = '' 26 + A run-time path to the token file, which is supposed to be provisioned 27 + outside of Nix store. 28 + ''; 29 + }; 30 + }; 31 + serviceOpts = { 32 + script = '' 33 + ${optionalString (cfg.tokenPath != null) 34 + "export FASTLY_API_TOKEN=$(cat ${toString cfg.tokenPath})"} 35 + ${pkgs.fastly-exporter}/bin/fastly-exporter \ 36 + -endpoint http://${cfg.listenAddress}:${cfg.port}/metrics 37 + ${optionalString cfg.debug "-debug true"} \ 38 + ${optionalString cfg.configFile "-config-file ${cfg.configFile}"} 39 + ''; 40 + }; 41 + }
+22
pkgs/servers/monitoring/prometheus/fastly-exporter.nix
···
··· 1 + { lib, buildGoModule, fetchFromGitHub }: 2 + 3 + buildGoModule rec { 4 + pname = "fastly-exporter"; 5 + version = "6.1.0"; 6 + 7 + src = fetchFromGitHub { 8 + owner = "peterbourgon"; 9 + repo = pname; 10 + rev = "v${version}"; 11 + sha256 = "0my0pcxix5rk73m5ciz513nwmjcm7vjs6r8wg3vddm0xixv7zq94"; 12 + }; 13 + 14 + vendorSha256 = "1w9asky8h8l5gc0c6cv89m38qw50hyhma8qbsw3zirplhk9mb3r2"; 15 + 16 + meta = with lib; { 17 + description = "Prometheus exporter for the Fastly Real-time Analytics API"; 18 + homepage = "https://github.com/peterbourgon/fastly-exporter"; 19 + license = licenses.asl20; 20 + maintainers = teams.deshaw.members; 21 + }; 22 + }
+1
pkgs/top-level/all-packages.nix
··· 20334 prometheus-dnsmasq-exporter = callPackage ../servers/monitoring/prometheus/dnsmasq-exporter.nix { }; 20335 prometheus-dovecot-exporter = callPackage ../servers/monitoring/prometheus/dovecot-exporter.nix { }; 20336 prometheus-domain-exporter = callPackage ../servers/monitoring/prometheus/domain-exporter.nix { }; 20337 prometheus-flow-exporter = callPackage ../servers/monitoring/prometheus/flow-exporter.nix { }; 20338 prometheus-fritzbox-exporter = callPackage ../servers/monitoring/prometheus/fritzbox-exporter.nix { }; 20339 prometheus-gitlab-ci-pipelines-exporter = callPackage ../servers/monitoring/prometheus/gitlab-ci-pipelines-exporter.nix { };
··· 20334 prometheus-dnsmasq-exporter = callPackage ../servers/monitoring/prometheus/dnsmasq-exporter.nix { }; 20335 prometheus-dovecot-exporter = callPackage ../servers/monitoring/prometheus/dovecot-exporter.nix { }; 20336 prometheus-domain-exporter = callPackage ../servers/monitoring/prometheus/domain-exporter.nix { }; 20337 + prometheus-fastly-exporter = callPackage ../servers/monitoring/prometheus/fastly-exporter.nix { }; 20338 prometheus-flow-exporter = callPackage ../servers/monitoring/prometheus/flow-exporter.nix { }; 20339 prometheus-fritzbox-exporter = callPackage ../servers/monitoring/prometheus/fritzbox-exporter.nix { }; 20340 prometheus-gitlab-ci-pipelines-exporter = callPackage ../servers/monitoring/prometheus/gitlab-ci-pipelines-exporter.nix { };