1{
2 lib,
3 stdenv,
4 fetchurl,
5 jre,
6 makeWrapper,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "jmx-prometheus-httpserver";
11 version = "0.15.0";
12
13 jarName = "jmx_prometheus_httpserver-${version}-jar-with-dependencies.jar";
14
15 src = fetchurl {
16 url = "mirror://maven/io/prometheus/jmx/jmx_prometheus_httpserver/${version}/${jarName}";
17 sha256 = "0fr3svn8kjp7bq1wzbkvv5awylwn8b01bngj04zvk7fpzqpgs7mz";
18 };
19
20 nativeBuildInputs = [ makeWrapper ];
21 buildInputs = [ jre ];
22
23 dontUnpack = true;
24
25 installPhase = ''
26 mkdir -p $out/libexec
27 mkdir -p $out/bin
28 cp $src $out/libexec/$jarName
29 makeWrapper "${jre}/bin/java" $out/bin/jmx_prometheus_httpserver --add-flags "-jar $out/libexec/$jarName"
30 '';
31
32 meta = with lib; {
33 homepage = "https://github.com/prometheus/jmx_exporter";
34 description = "Process for exposing JMX Beans via HTTP for Prometheus consumption";
35 mainProgram = "jmx_prometheus_httpserver";
36 sourceProvenance = with sourceTypes; [ binaryBytecode ];
37 license = licenses.asl20;
38 maintainers = [ maintainers.offline ];
39 platforms = platforms.unix;
40 };
41}