1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00

Merge pull request #291321 from c0deaddict/feature/nats-exporter

nixos/prometheus-nats-exporter: new module
This commit is contained in:
Aaron Andersen 2024-04-10 22:39:40 +00:00 committed by GitHub
commit d2b7e6797b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 0 deletions

View file

@ -163,6 +163,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
- [Uni-Sync](https://github.com/EightB1ts/uni-sync), a synchronization tool for Lian Li Uni Controllers. Available as [hardware.uni-sync](#opt-hardware.uni-sync.enable)
- [prometheus-nats-exporter](https://github.com/nats-io/prometheus-nats-exporter), a Prometheus exporter for NATS. Available as [services.prometheus.exporters.nats](#opt-services.prometheus.exporters.nats.enable).
## Backward Incompatibilities {#sec-release-24.05-incompatibilities}
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->

View file

@ -55,6 +55,7 @@ let
"modemmanager"
"mongodb"
"mysqld"
"nats"
"nextcloud"
"nginx"
"nginxlog"

View file

@ -0,0 +1,34 @@
{ config, lib, pkgs, options, ... }:
with lib;
let
cfg = config.services.prometheus.exporters.nats;
in
{
port = 7777;
extraOpts = {
url = mkOption {
type = types.str;
default = "http://127.0.0.1:8222";
description = ''
NATS monitor endpoint to query.
'';
};
};
serviceOpts = {
serviceConfig = {
ExecStart = ''
${pkgs.prometheus-nats-exporter}/bin/prometheus-nats-exporter \
-addr ${cfg.listenAddress} \
-port ${toString cfg.port} \
${concatStringsSep " \\\n " cfg.extraFlags} \
${cfg.url}
'';
};
};
}