2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, jre, makeWrapper }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2021-05-20 23:08:51 +00:00
|
|
|
version = "0.15.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
jarName = "jmx_prometheus_httpserver-${version}-jar-with-dependencies.jar";
|
2020-06-18 07:06:33 +00:00
|
|
|
mavenUrl = "mirror://maven/io/prometheus/jmx/jmx_prometheus_httpserver/${version}/${jarName}";
|
2020-04-24 23:36:52 +00:00
|
|
|
in stdenv.mkDerivation {
|
|
|
|
inherit version jarName;
|
|
|
|
|
|
|
|
name = "jmx-prometheus-httpserver-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = mavenUrl;
|
2021-05-20 23:08:51 +00:00
|
|
|
sha256 = "0fr3svn8kjp7bq1wzbkvv5awylwn8b01bngj04zvk7fpzqpgs7mz";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jre ];
|
2020-04-24 23:36:52 +00: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-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/prometheus/jmx_exporter";
|
|
|
|
description = "A process for exposing JMX Beans via HTTP for Prometheus consumption";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.offline ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|