-
Notifications
You must be signed in to change notification settings - Fork 37
Configuration
Cyrille Le Clerc edited this page Jun 4, 2013
·
8 revisions
EmbeddedJmxTrans configuration uses JSON and supports an Expression Language.
Key configuration nodes are "queries"
and "outputwriters"
JSON nodes. "outputwriters"
can be defined at the root level and at each query level.
{
"queries": [
...
],
"outputWriters": [
...
],
"queryIntervalInSeconds": 15,
"numQueryThreads": 1,
"exportIntervalInSeconds": 30
}
{
"objectName": "java.lang:type=GarbageCollector,name=PS MarkSweep",
"resultAlias": "jvm.gc.ps-marksweep",
"attribute": "CollectionCount"
}
{
"objectName": "java.lang:type=GarbageCollector,name=PS MarkSweep",
"resultAlias": "jvm.gc.ps-marksweep",
"attributes": ["CollectionCount", "CollectionTime"]
}
{
"objectName": "java.lang:type=GarbageCollector,name=PS MarkSweep",
"resultAlias": "jvm.gc.ps-marksweep",
"attributes": [
{
"name": "CollectionCount",
"resultAlias": "collection-count"
},
{
"name": "CollectionTime",
"resultAlias": "collection-time"
}
]
}
{
"objectName": "java.lang:type=Memory",
"resultAlias": "jvm.memory",
"attribute":
{
"name": "HeapMemoryUsage",
"keys": ["committed", "init", "max", "used"]
}
}
{
"objectName": "java.lang:type=Memory",
"resultAlias": "jvm.memory",
"attributes": [
{
"name": "HeapMemoryUsage",
"keys": ["committed", "init", "max", "used"]
},
{
"name": "NonHeapMemoryUsage",
"keys": ["committed", "init", "max", "used"]
}
]
}
{
"@class": "org.jmxtrans.embedded.output.GraphiteWriter",
"settings": {
"host": "${graphite.host:localhost}",
"port": "${graphite.port:2003}"
}
}
Note: this sample uses property placeholders with the {prop-name[:default-value]}
syntax. See Expression Language.
EmbeddedJmxTrans uses an expression language based on property placeholders (e.g. "{graphite.host:2003}
", ObjectName properties (e.g. "%name%
") and basic functions (e.g. "#canonical_hostname#
").
See Expression Language.
{
"queries": [
{
"objectName": "cocktail:type=CocktailManager,name=CocktailManager",
"resultAlias": "cocktail.cocktailmanager",
"attribute": "AddedCommentCount"
},
{
"objectName": "java.lang:type=GarbageCollector,name=PS MarkSweep",
"resultAlias": "jvm.gc.ps-marksweep",
"attributes": ["CollectionCount", "CollectionTime"]
},
{
"objectName": "java.lang:type=GarbageCollector,name=PS Scavenge",
"resultAlias": "jvm.gc.ps-scavenge",
"attributes": ["CollectionCount", "CollectionTime"]
},
{
"objectName": "java.lang:type=Memory",
"resultAlias": "jvm.memory",
"attributes": [
{
"name": "HeapMemoryUsage",
"keys": ["committed", "init", "max", "used"]
},
{
"name": "NonHeapMemoryUsage",
"keys": ["committed", "init", "max", "used"]
}
]
},
{
"objectName": "java.lang:type=Threading",
"resultAlias": "jvm.thread",
"attributes": ["ThreadCount", "TotalStartedThreadCount", "DaemonThreadCount"]
},
{
"objectName": "java.lang:type=Runtime",
"resultAlias": "jvm.runtime",
"attribute": "Uptime"
},
{
"objectName": "java.lang:type=OperatingSystem",
"resultAlias": "jvm.operatingsystem",
"attributes": ["SystemLoadAverage", "ProcessCpuTime", "FreePhysicalMemorySize", "FreeSwapSpaceSize"]
}
],
"outputWriters": [
{
"@class": "org.jmxtrans.embedded.output.Slf4jWriter"
},
{
"@class": "org.jmxtrans.embedded.output.GraphiteWriter",
"settings": {
"host": "${graphite.host:localhost}",
"port": "${graphite.port:2003}"
}
}
],
"queryIntervalInSeconds": 15,
"numQueryThreads": 1,
"exportIntervalInSeconds": 30
}
- Configuration
- ... Expression Language
- ... Configuration Sample
- Output Writers
- ... Graphite Writer
- ... StatsD Writer
- ... Graphite Pickle Writer
- ... Librato Writer
- ... SLF4J Writer
- ... Stackdriver Writer
- ... CopperEgg Writer
- ... Csv Writer
- ... Console Writer
- Integration
- ... Maven Setup
- ... Spring Integration
- ... Plain Java Servlet Integration
- Configuration Templates
- ... Tomcat
- ... JVM
- Internals
- ... Implementation Decisions
- ... Health Monitoring
- Latest javadocs
- Forum (Google Groups)
- Downloads
- Samples
- ... [Cocktail Web App] (https://github.com/jmxtrans/embedded-jmxtrans-samples/tree/master/embedded-jmxtrans-webapp-coktail)
- License
- Release Notes