2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, jre, makeWrapper }:
|
2018-07-11 20:17:09 +01:00
|
|
|
|
2021-07-25 22:53:02 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "jmx-prometheus-httpserver";
|
2021-05-11 05:26:36 +01:00
|
|
|
version = "0.15.0";
|
2018-07-11 20:17:09 +01:00
|
|
|
|
2021-07-25 22:53:02 +01:00
|
|
|
jarName = "jmx_prometheus_httpserver-${version}-jar-with-dependencies.jar";
|
2018-07-11 20:17:09 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-25 22:53:02 +01:00
|
|
|
url = "mirror://maven/io/prometheus/jmx/jmx_prometheus_httpserver/${version}/${jarName}";
|
2021-05-11 05:26:36 +01:00
|
|
|
sha256 = "0fr3svn8kjp7bq1wzbkvv5awylwn8b01bngj04zvk7fpzqpgs7mz";
|
2018-07-11 20:17:09 +01:00
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jre ];
|
2018-07-11 20:17:09 +01:00
|
|
|
|
2021-07-24 22:08:56 +01:00
|
|
|
dontUnpack = true;
|
2018-07-11 20:17:09 +01:00
|
|
|
|
|
|
|
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 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/prometheus/jmx_exporter";
|
2018-07-11 20:17:09 +01:00
|
|
|
description = "A process for exposing JMX Beans via HTTP for Prometheus consumption";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.offline ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|