forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request NixOS#131578 from mweinelt/influxdb-exporter
prometheus-influxdb-exporter: init at 0.8.0
- Loading branch information
Showing
7 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ let | |
"domain" | ||
"dovecot" | ||
"fritzbox" | ||
"influxdb" | ||
"json" | ||
"jitsi" | ||
"kea" | ||
|
34 changes: 34 additions & 0 deletions
34
nixos/modules/services/monitoring/prometheus/exporters/influxdb.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ config, lib, pkgs, options }: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.services.prometheus.exporters.influxdb; | ||
in | ||
{ | ||
port = 9122; | ||
extraOpts = { | ||
sampleExpiry = mkOption { | ||
type = types.str; | ||
default = "5m"; | ||
example = "10m"; | ||
description = "How long a sample is valid for"; | ||
}; | ||
udpBindAddress = mkOption { | ||
type = types.str; | ||
default = ":9122"; | ||
example = "192.0.2.1:9122"; | ||
description = "Address on which to listen for udp packets"; | ||
}; | ||
}; | ||
serviceOpts = { | ||
serviceConfig = { | ||
RuntimeDirectory = "prometheus-influxdb-exporter"; | ||
ExecStart = '' | ||
${pkgs.prometheus-influxdb-exporter}/bin/influxdb_exporter \ | ||
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \ | ||
--influxdb.sample-expiry ${cfg.sampleExpiry} ${concatStringsSep " " cfg.extraFlags} | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ lib, buildGoModule, fetchFromGitHub, nixosTests }: | ||
|
||
buildGoModule rec { | ||
pname = "influxdb_exporter"; | ||
version = "0.8.0"; | ||
rev = "v${version}"; | ||
|
||
src = fetchFromGitHub { | ||
inherit rev; | ||
owner = "prometheus"; | ||
repo = "influxdb_exporter"; | ||
sha256 = "sha256-aNj4ru3yDet+jdcEpckFVaymmjWmKzTMPcTxPMNFbgo="; | ||
}; | ||
|
||
vendorSha256 = null; | ||
|
||
buildFlagsArray = let | ||
goPackagePath = "github.com/prometheus/influxdb_exporter"; | ||
in '' | ||
-ldflags= | ||
-s -w | ||
-X github.com/prometheus/common/version.Version=${version} | ||
-X github.com/prometheus/common/version.Revision=${rev} | ||
-X github.com/prometheus/common/version.Branch=unknown | ||
-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs | ||
-X github.com/prometheus/common/version.BuildDate=unknown | ||
''; | ||
|
||
passthru.tests = { inherit (nixosTests.prometheus-exporters) influxdb; }; | ||
|
||
meta = with lib; { | ||
description = "Prometheus exporter that accepts InfluxDB metrics"; | ||
homepage = "https://github.com/prometheus/influxdb_exporter"; | ||
license = licenses.asl20; | ||
maintainers = with maintainers; [ hexa ]; | ||
platforms = platforms.unix; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters