A sidecar to run alongside Trino to gather metrics using the JMX connector and expose them in different formats using Apache velocity

Overview

Overview

A sidecar to run alongside Trino to gather metrics using the JMX connector and expose them in different formats using Apache Velocity.

Click here for more information about JMX connector.


Configuration

Trino JMX Connector

The sidecar uses Micronaut Framework running on port 8090.

Sidecar API and all other required values to Trino's JMX connector are located at /src/resources/application.yml.

Default values:

#...
trino:
  host: "localhost"
  port: 8080
  authentication:
    user: "test"

Exporters and metrics

Exporters configuration files are located under /src/resources/ folder using YAML syntax.

For each exporter, all its metric configurations are loaded underneath its name property folder.

Example:

/src/resources/exporter/prometheus.yml          <-- Prometheus exporter config file
/src/resources/exporter/prometheus/runtime.yml  <-- Metric config file loaded into Prometheus
/src/resources/exporter/prometheus/xyz.yml      <-- Another config file loaded into Prometheus

API endpoints

List all available JMX MBeans


Request

GET /mbeans

curl -i -H 'Accept: application/json' http://localhost:8090/mbeans

Response

[
    "com.sun.management:type=diagnosticcommand",
    "com.sun.management:type=hotspotdiagnostic",
    "io.airlift.discovery.client:name=announcer",
    "io.airlift.discovery.client:name=serviceinventory",
    "io.airlift.http.client:name=fordiscoveryclient,type=httpclient",
    "io.airlift.http.server:context=http_1_1_h2c@3e5cbcfe,id=0,type=httpserverchannellistener",
    "io.airlift.http.server:name=requeststats",
    "io.airlift.jmx:name=stacktracembean",
    "io.airlift.stats:name=gcmonitor",
    "io.airlift.stats:name=pausemeter",
    "java.lang:name=metaspace manager,type=memorymanager",
    "java.lang:name=metaspace,type=memorypool",
    "java.lang:type=memory",
    "java.lang:type=operatingsystem",
    "java.lang:type=runtime",
    "java.lang:type=threading"
]

Fetch available MBean attributes from given MBean name


Request

GET /mbean/{mBeanName}

curl -i -H 'Accept: application/json' 'http://localhost:8090/mbean/java.lang:type=runtime'

Response

[
    {
        "vmversion": "11.0.12+7-LTS",
        "systemproperties": "javax.management.openmbean.TabularDataSupport(tabularType=javax.management.openmbean.T...",
        "classpath": "/usr/lib/trino/lib/joda-time-2.10.10.jar:/usr/lib/trino/lib/jackson-datatype-guava-2.12.3.jar...",
        "specname": "Java Virtual Machine Specification",
        "objectname": "java.lang:type=Runtime",
        "managementspecversion": "2.0",
        "pid": "1",
        "starttime": "1634822189154",
        "vmname": "OpenJDK 64-Bit Server VM",
        "specvendor": "Oracle Corporation",
        "uptime": "5044819",
        "vmvendor": "Azul Systems, Inc.",
        "node": "8896abd3b013",
        "bootclasspath": null,
        "librarypath": "/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib",
        "object_name": "java.lang:type=Runtime",
        "name": "1@8896abd3b013",
        "bootclasspathsupported": "false",
        "inputarguments": "[-Xmx1G, -XX:-UseBiasedLocking, -XX:+UseG1GC, -XX:G1HeapRegionSize=32M, -XX:+ExplicitGCI...",
        "specversion": "11"
    }
]

Export MBean configured metrics from a specific exporter


Request

GET /metrics/{exporter}

curl -i -H 'Accept: application/json' 'http://localhost:8090/metrics/prometheus'

Response

# HELP java_lang_type_runtime_total Amount of time VM is up
# TYPE java_lang_type_runtime_total GAUGE
java_lang_type_runtime_total 5107591
You might also like...

Small set of tools for JVM troublshooting, monitoring and profiling.

Swiss Java Knife (SJK) SJK is a command line tool for JVM diagnostic, troubleshooting and profiling. SJK exploits standard diagnostic interfaces of JV

Jan 3, 2023

Best-of-breed OpenTracing utilities, instrumentations and extensions

OpenTracing Toolbox OpenTracing Toolbox is a collection of libraries that build on top of OpenTracing and provide extensions and plugins to existing i

Oct 15, 2022

A short and practical intro into project loom

A short and practical intro into project loom

project-loom Project loom is all about making concurrency easier (for developers) on the JVM. It is in experimental phase. Download the early access b

Dec 15, 2021

One file java script for visualizing JDK flight recorder execution logs as flamegraphs without any dependencies except Java and a browser.

Flamegraph from JFR logs Simple one file Java script to generate flamegraphs from Java flight recordings without installing Perl and the Brendan Gregg

Oct 2, 2022

Simple Anti-Dump to slow down and annoy attackers.

Anti-Dump A simple Anti-Dump to slow down and annoy attackers. Usage Copy the class into your mod or loader. Rename any instances of dummy/class/path

Dec 25, 2022

Kotlin-decompiled - (Almost) every single language construct of the Kotlin programming language compiled to JVM bytecode and then decompiled to Java again for better readability

Kotlin: Decompiled (Almost) every single language construct of the Kotlin programming language compiled to JVM bytecode and then decompiled to Java ag

Dec 14, 2022

An OpenJDK release maintained and supported by SAP

SapMachine This project contains a downstream version of the OpenJDK project. It is used to build and maintain a SAP supported version of OpenJDK for

Jan 3, 2023

Dynamic loading and compiling project based on JVM

camphor 基于jvm的弹性加载及编译中间件(Elastic loading and compiling middleware based on JVM) camphor_0.0.1 项目简介 该项目定位为弹性中间件,能够使系统在不重启的情况下完成增量代码文件的动态编译和加载 模块介绍 camp

Jan 22, 2022

JavaOTTF - Official OTTF parser and composer for JVM languages

JavaOTTF - Official OTTF parser and composer for JVM languages

JavaOTTF Official OTTF parser and composer for JVM languages. Documentation Please refer to the Wiki Section. Installation Maven Add repository into p

Nov 21, 2022
Owner
BlueCat Engineering
BlueCat Engineering
Terminal UI JMX (Java management extension) viewer

JMXViewer Terminal UI JMX (Java management extension) viewer Usage java -jar jmxviewer.jar [pid] The PID is optional. If it is not provided, the appli

Ivan Yurchenko 20 Sep 15, 2022
Simple JVM Profiler Using StatsD and Other Metrics Backends

statsd-jvm-profiler statsd-jvm-profiler is a JVM agent profiler that sends profiling data to StatsD. Inspired by riemann-jvm-profiler, it was primaril

Etsy, Inc. 330 Oct 30, 2022
JVM Profiler Sending Metrics to Kafka, Console Output or Custom Reporter

Uber JVM Profiler Uber JVM Profiler provides a Java Agent to collect various metrics and stacktraces for Hadoop/Spark JVM processes in a distributed w

Uber Common 1.7k Dec 22, 2022
面向开发人员、声明式的 Metrics 采集与监控系统,可以对结构化与非结构化、有界数据与无界数据进行采集,通过对采集数据进行提取、过滤、逻辑运算等处理后将结果存储流行的监控系统或存储引擎中(如 Prometheus、Nightingale、Open-Falcon)从而搭建起完整的监控体系,同时也可以结合 grafana 完成数据的可视化

介绍 AnyMetrics - 面向开发人员、声明式的 Metrics 采集与监控系统,可以对结构化与非结构化、有界数据与无界数据进行采集,通过对采集数据进行提取、过滤、逻辑运算、聚合等处理后将结果存储流行的监控系统或存储引擎中(如 Prometheus、Nightingale、Open-Falco

lichao 6 Aug 16, 2021
💥 Crasher - open source dump/crash server for different programming languages (used for crash analysis in various applications)

Crashser Crasher - open source dump/crash server for different programming languages (used for crash analysis in various applications). Supported lang

Balun Vladimir 14 Oct 6, 2022
The Java agent for Apache SkyWalking

Apache SkyWalking Java Agent SkyWalking-Java: The Java Agent for Apache SkyWalking, which provides the native tracing/metrics/logging abilities for Ja

The Apache Software Foundation 447 Jan 5, 2023
Detect if the system is recording, mirroring, or using AirPlay to stream the contents of the screen.

react-native-is-screen-captured-ios Detect if the system is recording, mirroring, or using AirPlay to stream the contents of the screen. https://devel

Dylan 20 Dec 30, 2022
Sampling CPU and HEAP profiler for Java featuring AsyncGetCallTrace + perf_events

async-profiler This project is a low overhead sampling profiler for Java that does not suffer from Safepoint bias problem. It features HotSpot-specifi

null 5.8k Jan 3, 2023
Get Method Sampling from Java Flight Recorder Dump and convert to FlameGraph compatible format.

Note: Travis has removed the support for Oracle JDK 8. Therefore the build status is removed temporarily. Converting JFR Method Profiling Samples to F

M. Isuru Tharanga Chrishantha Perera 248 Dec 16, 2022
Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.

JITWatch Log analyser and visualiser for the HotSpot JIT compiler. Video introduction to JITWatch video Slides from my LJC lightning talk on JITWatch

AdoptOpenJDK 2.8k Jan 3, 2023