mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 12:59:04 +02:00
Merge pull request #133726 from deshaw/fastly-exporter
prometheus-fastly-exporter: init at v6.1.0
This commit is contained in:
commit
6c88e85807
|
@ -32,6 +32,7 @@ let
|
|||
"dnsmasq"
|
||||
"domain"
|
||||
"dovecot"
|
||||
"fastly"
|
||||
"fritzbox"
|
||||
"influxdb"
|
||||
"json"
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
{ config, lib, pkgs, options }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.services.prometheus.exporters.fastly;
|
||||
in
|
||||
{
|
||||
port = 9118;
|
||||
extraOpts = {
|
||||
debug = mkEnableOption "Debug logging mode for fastly-exporter";
|
||||
|
||||
configFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
description = ''
|
||||
Path to a fastly-exporter configuration file.
|
||||
Example one can be generated with <literal>fastly-exporter --config-file-example</literal>.
|
||||
'';
|
||||
example = "./fastly-exporter-config.txt";
|
||||
};
|
||||
|
||||
tokenPath = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
apply = final: if final == null then null else toString final;
|
||||
description = ''
|
||||
A run-time path to the token file, which is supposed to be provisioned
|
||||
outside of Nix store.
|
||||
'';
|
||||
};
|
||||
};
|
||||
serviceOpts = {
|
||||
script = ''
|
||||
${optionalString (cfg.tokenPath != null)
|
||||
"export FASTLY_API_TOKEN=$(cat ${toString cfg.tokenPath})"}
|
||||
${pkgs.fastly-exporter}/bin/fastly-exporter \
|
||||
-endpoint http://${cfg.listenAddress}:${cfg.port}/metrics
|
||||
${optionalString cfg.debug "-debug true"} \
|
||||
${optionalString cfg.configFile "-config-file ${cfg.configFile}"}
|
||||
'';
|
||||
};
|
||||
}
|
22
pkgs/servers/monitoring/prometheus/fastly-exporter.nix
Normal file
22
pkgs/servers/monitoring/prometheus/fastly-exporter.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "fastly-exporter";
|
||||
version = "6.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "peterbourgon";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "0my0pcxix5rk73m5ciz513nwmjcm7vjs6r8wg3vddm0xixv7zq94";
|
||||
};
|
||||
|
||||
vendorSha256 = "1w9asky8h8l5gc0c6cv89m38qw50hyhma8qbsw3zirplhk9mb3r2";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Prometheus exporter for the Fastly Real-time Analytics API";
|
||||
homepage = "https://github.com/peterbourgon/fastly-exporter";
|
||||
license = licenses.asl20;
|
||||
maintainers = teams.deshaw.members;
|
||||
};
|
||||
}
|
|
@ -20735,6 +20735,7 @@ with pkgs;
|
|||
prometheus-dnsmasq-exporter = callPackage ../servers/monitoring/prometheus/dnsmasq-exporter.nix { };
|
||||
prometheus-dovecot-exporter = callPackage ../servers/monitoring/prometheus/dovecot-exporter.nix { };
|
||||
prometheus-domain-exporter = callPackage ../servers/monitoring/prometheus/domain-exporter.nix { };
|
||||
prometheus-fastly-exporter = callPackage ../servers/monitoring/prometheus/fastly-exporter.nix { };
|
||||
prometheus-flow-exporter = callPackage ../servers/monitoring/prometheus/flow-exporter.nix { };
|
||||
prometheus-fritzbox-exporter = callPackage ../servers/monitoring/prometheus/fritzbox-exporter.nix { };
|
||||
prometheus-gitlab-ci-pipelines-exporter = callPackage ../servers/monitoring/prometheus/gitlab-ci-pipelines-exporter.nix { };
|
||||
|
|
Loading…
Reference in a new issue