https://github.com/dodevops/scalyr-jmxtrans
An Scaylr agent for fetching JMX metrics using JMXtrans and Graphite.
https://github.com/dodevops/scalyr-jmxtrans
Last synced: 11 months ago
JSON representation
An Scaylr agent for fetching JMX metrics using JMXtrans and Graphite.
- Host: GitHub
- URL: https://github.com/dodevops/scalyr-jmxtrans
- Owner: dodevops
- License: mit
- Created: 2020-10-05T06:02:18.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-07T07:51:08.000Z (over 5 years ago)
- Last Synced: 2025-07-10T17:52:18.253Z (12 months ago)
- Language: Shell
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scalyr JMX fetching
  
## Introduction
This repository holds a Dockerized solution for fetching JMX metrics and
transferring them to the [Scalyr Cloud](https://scalyr.com).
As Scalyr doesn't support JMX out of the box yet, this is done by fetching
JMX metrics using [JMXTRANS](http://jmxtrans.org/) and feeding them to
the Scalyr agent using the
[Graphite relay](https://app.scalyr.com/help/data-sources#graphite) feature.
## Usage
Start your app and a container using this image as a sidecar container and
set the following environment variables:
* JMX_PORT: The JMX port your app JVM listens to on localhost
* JMX_USERNAME: (optional) username to use when connecting
* JMX_PASSWORD: (optional) password to use when connecting
* JMX_QUERIES: The JMX queries to run from JMXTRANS
* SCALYR_VERSION: Version of the Scalyr agent to install
* SCALYR_APIKEY: API Key to use when sending to scalyr
* SCALYR_SERVER: Scalyr Server to send logs to
## Queries
The JMX_QUERIES environment variable holds a list of queries for JMXTRANS.
It is formatted as:
* All queries are separated by |
* A query starts with the JMX bean object to query (e.g. java.lang:type=Memory)
* After the query a ; separates the query from the attributes to fetch
* The attributes are separated by , (e.g. HeapMemoryUsage,NonHeapMemoryUsage)
This will add the requested queries to the JMXTRANS configuration and write
all results to Scalyr.
The resulting metrics will have the full object class path as a key (e.g. sun_management_MemoryImpl_HeapMemoryUsage.used).
If you like to shorten that up, you can add an @ and an alias to the object name.
Please see [JMXTRANS' queries documentation](https://github.com/jmxtrans/jmxtrans/wiki/Queries) for more details.
## Example
JMX_QUERIES=java.lang:type=Memory@memory;HeapMemoryUsage,NonHeapMemoryUsage|java.lang:type=Threading@threading;ThreadCount
Will fetch the following beans and attributes:
* java.lang:type=Memory (metrics received from this bean are prefixed with the alias "memory")
* HeapMemoryUsage
* NonHeapMemoryUsage
* java.lang:type=Threading (metrics received from this bean are prefixed with the alias "threading")
* ThreadCount