2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchurl, jre, makeWrapper }:
|
2018-07-11 21:17:09 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
version = "0.10";
|
|
|
|
jarName = "jmx_prometheus_httpserver-${version}-jar-with-dependencies.jar";
|
2020-06-12 16:26:08 +02:00
|
|
|
mavenUrl = "mirror://maven/io/prometheus/jmx/jmx_prometheus_httpserver/${version}/${jarName}";
|
2018-07-11 21:17:09 +02:00
|
|
|
in stdenv.mkDerivation {
|
|
|
|
inherit version jarName;
|
|
|
|
|
|
|
|
name = "jmx-prometheus-httpserver-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = mavenUrl;
|
|
|
|
sha256 = "1pvqphrirq48xhmx0aa6vkxz6qy1cx2q6jxsh7rin432iap7j62f";
|
|
|
|
};
|
|
|
|
|
2021-02-07 10:17:39 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jre ];
|
2018-07-11 21:17:09 +02:00
|
|
|
|
|
|
|
phases = "installPhase";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/libexec
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp $src $out/libexec/$jarName
|
|
|
|
makeWrapper "${jre}/bin/java" $out/bin/jmx_prometheus_httpserver --add-flags "-jar $out/libexec/$jarName"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/prometheus/jmx_exporter";
|
2018-07-11 21:17:09 +02:00
|
|
|
description = "A process for exposing JMX Beans via HTTP for Prometheus consumption";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.offline ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|