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