eiiches / scriptable-jmx-exporter

A javaagent for scraping and exposing MBeans to Prometheus
MIT License
7 stars 2 forks source link

add `jmx` jq function to retrieve a MBean value #3

Closed eiiches closed 6 years ago

eiiches commented 6 years ago

E.g. jmx("java.lang:type=OperatingSystem"; "Version"}.

I'd like to use this value in metric labels.

Related: #1

eiiches commented 6 years ago

java.lang:type=Runtime:VmVersion might also be useful.

eiiches commented 6 years ago
labels: |
  {
    os_version: jmx("java.lang:type=OperatingSystem"; "Version"),
    jvm_version: jmx("java.lang:type=Runtime"; "VmVersion")
  }
eiiches commented 6 years ago

Fixed in 1b96eb1a21bbec84d68769051dcefd5e73df5024.