diff options
author | Louis Blin <45168934+lbpdt@users.noreply.github.com> | 2021-01-31 00:03:55 +0000 |
---|---|---|
committer | Louis Blin <45168934+lbpdt@users.noreply.github.com> | 2021-02-11 15:56:58 +0000 |
commit | 458fafa8fc9c83d9f0648e2758e8e0ddd45bc5ad (patch) | |
tree | bf1c187bd6c3489210ebe209cff2d1179a521473 /nixos/modules/services/monitoring/prometheus/exporters/artifactory.nix | |
parent | b85a0ba2c2cd467c32e5cea3e8b02f0ed8d62a27 (diff) | |
download | nixpkgs-458fafa8fc9c83d9f0648e2758e8e0ddd45bc5ad.tar nixpkgs-458fafa8fc9c83d9f0648e2758e8e0ddd45bc5ad.tar.gz nixpkgs-458fafa8fc9c83d9f0648e2758e8e0ddd45bc5ad.tar.bz2 nixpkgs-458fafa8fc9c83d9f0648e2758e8e0ddd45bc5ad.tar.lz nixpkgs-458fafa8fc9c83d9f0648e2758e8e0ddd45bc5ad.tar.xz nixpkgs-458fafa8fc9c83d9f0648e2758e8e0ddd45bc5ad.tar.zst nixpkgs-458fafa8fc9c83d9f0648e2758e8e0ddd45bc5ad.zip |
nixos/prometheus-exporters/artifactory: init at 1.9.0
Adds a Prometheus exporter to scrape metrics from the API of JFrog Artifactory instances.
Diffstat (limited to 'nixos/modules/services/monitoring/prometheus/exporters/artifactory.nix')
-rw-r--r-- | nixos/modules/services/monitoring/prometheus/exporters/artifactory.nix | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/artifactory.nix b/nixos/modules/services/monitoring/prometheus/exporters/artifactory.nix new file mode 100644 index 00000000000..2adcecc728b --- /dev/null +++ b/nixos/modules/services/monitoring/prometheus/exporters/artifactory.nix @@ -0,0 +1,59 @@ +{ config, lib, pkgs, options }: + +with lib; + +let + cfg = config.services.prometheus.exporters.artifactory; +in +{ + port = 9531; + extraOpts = { + scrapeUri = mkOption { + type = types.str; + default = "http://localhost:8081/artifactory"; + description = '' + URI on which to scrape JFrog Artifactory. + ''; + }; + + artiUsername = mkOption { + type = types.str; + description = '' + Username for authentication against JFrog Artifactory API. + ''; + }; + + artiPassword = mkOption { + type = types.str; + default = ""; + description = '' + Password for authentication against JFrog Artifactory API. + One of the password or access token needs to be set. + ''; + }; + + artiAccessToken = mkOption { + type = types.str; + default = ""; + description = '' + Access token for authentication against JFrog Artifactory API. + One of the password or access token needs to be set. + ''; + }; + }; + serviceOpts = { + serviceConfig = { + ExecStart = '' + ${pkgs.prometheus-artifactory-exporter}/bin/artifactory_exporter \ + --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \ + --artifactory.scrape-uri ${cfg.scrapeUri} \ + ${concatStringsSep " \\\n " cfg.extraFlags} + ''; + Environment = [ + "ARTI_USERNAME=${cfg.artiUsername}" + "ARTI_PASSWORD=${cfg.artiPassword}" + "ARTI_ACCESS_TOKEN=${cfg.artiAccessToken}" + ]; + }; + }; +} |