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