{"id":19145524,"url":"https://github.com/jmxtrans/jmxtrans-agent","last_synced_at":"2025-05-15T07:03:52.583Z","repository":{"id":41894637,"uuid":"9603892","full_name":"jmxtrans/jmxtrans-agent","owner":"jmxtrans","description":"Java Agent based JMX metrics exporter.","archived":false,"fork":false,"pushed_at":"2024-11-14T09:47:48.000Z","size":996,"stargazers_count":180,"open_issues_count":28,"forks_count":110,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-05-15T07:03:50.302Z","etag":null,"topics":["graphite-carbon","java","java-agent","jmx","jmxtrans","jmxtrans-agent"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmxtrans.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-04-22T16:49:49.000Z","updated_at":"2025-05-09T02:59:42.000Z","dependencies_parsed_at":"2024-11-09T07:40:58.860Z","dependency_job_id":"7c6f17ef-697b-4528-b597-f7dff34343f8","html_url":"https://github.com/jmxtrans/jmxtrans-agent","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmxtrans%2Fjmxtrans-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmxtrans%2Fjmxtrans-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmxtrans%2Fjmxtrans-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmxtrans%2Fjmxtrans-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmxtrans","download_url":"https://codeload.github.com/jmxtrans/jmxtrans-agent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254291974,"owners_count":22046425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphite-carbon","java","java-agent","jmx","jmxtrans","jmxtrans-agent"],"created_at":"2024-11-09T07:40:45.435Z","updated_at":"2025-05-15T07:03:52.551Z","avatar_url":"https://github.com/jmxtrans.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jmxtrans Agent\n\n[![Travis](https://img.shields.io/travis/jmxtrans/jmxtrans-agent.svg)]()\n[![GitHub issues](https://img.shields.io/github/issues/jmxtrans/jmxtrans-agent.svg)](https://github.com/jmxtrans/jmxtrans-agent/issues)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/jmxtrans/jmxtrans-agent/master/LICENSE)\n[![GitHub forks](https://img.shields.io/github/forks/jmxtrans/jmxtrans-agent.svg)](https://github.com/jmxtrans/jmxtrans-agent/network)\n[![GitHub stars](https://img.shields.io/github/stars/jmxtrans/jmxtrans-agent.svg)](https://github.com/jmxtrans/jmxtrans-agent/stargazers)\n\n\n## What is jmxtrans-agent ?\n\njmxtrans-agent is a version of [jmxtrans](https://github.com/jmxtrans/jmxtrans) intended to be used as a java agent. JmxTrans Agent has zero dependencies to ease integration.\n\n## Java Agent Declaration\n\nDownload the [latest release](https://github.com/jmxtrans/jmxtrans-agent/releases/latest) of `jmxtrans-agent-\u003cversion\u003e.jar`\n\nSample `setenv.sh` for Apache Tomcat\n\n```\nexport JAVA_OPTS=\"$JAVA_OPTS -javaagent:/path/to/jmxtrans-agent-1.2.10.jar=jmxtrans-agent.xml\"\n```\n\n* java agent jar path can be relative to the working dir\n* `jmxtrans-agent.xml` is the configuration file, can be classpath relative (`classpath:…`), http(s) (`http(s)://...`) or file system based (relative to the working dir)\n\n### Delayed startup (version \u003e= 1.2.1)\n\nFor some application servers like JBoss, delaying premain is needed to start the agent, see [WFLY-3054](https://issues.jboss.org/browse/WFLY-3054)\nThis has been confirmed to be needed with JBoss 5.x, 6.x, 7.x and Wildfly 8.x. This is because a\ncustom `MBeanServer` is used by programmatically setting the [\"javax.management.builder.initial\"\nsystem property](https://docs.oracle.com/javase/9/docs/api/javax/management/MBeanServerFactory.html)\nin JBoss's startup sequence. If the `PlatformMBeanServer` is initialized before this is set, the\n`PlatformMBeanServer` will not use the implementation JBoss expects.\n\nFor versions \u003e=1.2.8, you can wait for the custom MBeanServer to be defined, set `jmxtrans.agent.premain.waitForCustomMBeanServer=true`:\n\n```\n# delays calling premain() in jmxtrans agent until javax.management.builder.initial is set, up to 2 minutes\njava -Djmxtrans.agent.premain.waitForCustomMBeanServer=true\n```\n\nThis usually takes less than a second. If needed, you can optionally increase the timeout to wait by setting `jmxtrans.agent.premain.waitForCustomMBeanServer.timeoutInSeconds` (defaults to 2 minutes):\n\n```\n# delays calling premain() in jmxtrans agent until javax.management.builder.initial is set, up to 5 minutes\njava -Djmxtrans.agent.premain.waitForCustomMBeanServer=true -Djmxtrans.agent.premain.waitForCustomMBeanServer.timeoutInSeconds=300\n```\n\nFor versions \u003c1.2.8, you have to add a flat delay. To add a flat delay set `jmxtrans.agent.premain.delay` (value in seconds):\n\n```\n# delays calling premain() in jmxtrans agent for 30 seconds\njava -Djmxtrans.agent.premain.delay=30\n```\n\n## Query configuration\n\n### Selecting attributes\n\nTo select which attributes to collect, use the `attribute` or `attributes` attribute on the `query` element. `attribute` accepts a\nsingle attribute while `attributes` accepts a comma-separated list of attributes to collect. If you do not specify any attributes, all attributes\nof the MBean will be dynamically discovered and collected. Use the [expression language](https://github.com/jmxtrans/jmxtrans-agent/wiki/Expression-Language) `#attribute#` in the `resultAlias`\nto use the attribute name in the metric name when collecting many attributes.\n\nExample - collect the `ThreadCount` attribute from the Threading MBean:\n\n```xml\n\u003cquery objectName=\"java.lang:type=Threading\" attribute=\"ThreadCount\"\n   resultAlias=\"jvm.thread.count\"/\u003e\n```\n\nExample - collect the `SystemLoadAverage` gauge attribute from the OperatingSystem MBean:\n\n```xml\n\u003cquery objectName=\"java.lang:type=OperatingSystem\" attributes=\"SystemLoadAverage\" \n       type=\"gauge\" resultAlias=\"#attribute#\"/\u003e\n```\n\n(i) Note that the `type` attribute is customizable. Output writers such as the [LibratoWriter](https://github.com/jmxtrans/jmxtrans-agent/blob/jmxtrans-agent-1.2.4/src/main/java/org/jmxtrans/agent/LibratoWriter.java), [StatsDOutputWriter](https://github.com/jmxtrans/jmxtrans-agent/blob/jmxtrans-agent-1.2.4/src/main/java/org/jmxtrans/agent/StatsDOutputWriter.java) and [PerMinuteSummarizerOutputWriter](https://github.com/jmxtrans/jmxtrans-agent/blob/jmxtrans-agent-1.2.4/src/main/java/org/jmxtrans/agent/PerMinuteSummarizerOutputWriter.java) are aware of the `type`s `counter` and `gauge` and assume that non defined `type`means `counter`.\n\nExample - collect `ThreadCount` and `TotalStartedThreadCount` from the Threading MBean:\n\n```xml\n\u003cquery objectName=\"java.lang:type=Threading\" attributes=\"ThreadCount,TotalStartedThreadCount\"\n  resultAlias=\"jvm.threads.#attribute#\"/\u003e\n```\n\nExample - collect all attributes from the Threading MBean:\n\n```xml\n\u003cquery objectName=\"java.lang:type=Threading\" resultAlias=\"jvm.threads.#attribute#\"/\u003e\n```\n\n\n### Simple mono-valued attribute\n\nUse `attribute` or `attributes` to specify the values to lookup. No additional configuration is required.\nSee `javax.management.MBeanServer.getAttribute(objectName, attribute)`.\n\n```xml\n\u003cquery objectName=\"java.lang:type=Threading\" attribute=\"ThreadCount\"\n   resultAlias=\"jvm.thread\"/\u003e\n```\n\n\n### MBean Composite Data attribute (CompositeData or Map)\n\nUse `key` to specify the key of the CompositeData or Map. See `javax.management.openmbean.CompositeData#get(key)`.\n\n```xml\n \u003cquery objectName=\"java.lang:type=Memory\" attribute=\"HeapMemoryUsage\" key=\"used\"\n    resultAlias=\"jvm.heapMemoryUsage.used\"/\u003e\n```\n\n* You can collect all the keys of the composite data or map omitting `key` in the `\u003cquery /\u003e` declaration.\n* Use the [expression language](https://github.com/jmxtrans/jmxtrans-agent/wiki/Expression-Language) `#key#` (or its synonym `#compositeDataKey#`) in the `resultAlias` to use the composite data key in the metric name. Sample:\n\n```xml\n \u003cquery objectName=\"java.lang:type=Memory\" attribute=\"HeapMemoryUsage\" resultAlias=\"jvm.heapMemoryUsage.#key#\"/\u003e\n```\n\n### Multi-valued data (Iterable or array)\n\nUse `position` to specify the value to lookup. Position is `0 based.\n\n```xml\n \u003cquery objectName=\"MyApp:type=MyMBean\" attribute=\"MyMultiValuedAttribute\" position=\"2\"\n    resultAlias=\"myMBean.myMultiValuedAttributeValue\"/\u003e\n```\n\n* `position` is 0 based\n* You can collect all the entries of the multi-valued data omitting `position` in the `\u003cquery /\u003e` declaration.\n* Use the [expression language](https://github.com/jmxtrans/jmxtrans-agent/wiki/Expression-Language) `#position#` in the `resultAlias` to use the multi-valued data position in the metric name. Sample:\n\n```xml\n \u003cquery objectName=\"MyApp:type=MyMBean\" attribute=\"MyMultiValuedAttribute\" resultAlias=\"myMBean.myMultiValuedAttributeValue.#position#\"/\u003e\n```\n\n* If no `resultAlias` is specified, the generated metric name is suffixed by `_#position#`. Sample:\n\n```\nmyMBean.myMultiValuedAttributeValue_0`\n```\n\n## Additional Configuration\n\n### Dynamic configuration reloading\nThe configuration can be dynamically reloaded at runtime. To enable this feature, enable it with the `reloadConfigurationCheckIntervalInSeconds` element, e.g.:\n\n```xml\n\u003creloadConfigurationCheckIntervalInSeconds\u003e60\u003c/reloadConfigurationCheckIntervalInSeconds\u003e\n```\n\n### Collection interval\n\nThe interval for collecting data using the specified queries and invocations can be specified with the element `collectIntervalInSeconds`, e.g.:\n\n```xml\n\u003ccollectIntervalInSeconds\u003e20\u003c/collectIntervalInSeconds\u003e\n```\n\nThe collect interval can be overridden for a specific query or invocation by setting the `collectIntervalInSeconds` attribute, e.g.:\n\n```xml\n\u003cquery objectName=\"java.lang:type=Threading\" attributes=\"ThreadCount,TotalStartedThreadCount\"\n   resultAlias=\"jvm.threads.#attribute#\" collectIntervalInSeconds=\"5\"/\u003e\n```\n\n### ResultNameStrategy\n\nThe `ResultNameStrategy` is the component in charge of building the metric name. The default implementation uses the `resultAlias`  if provided\nand otherwise will build the metric name using the `ObjectName`.\n\nYou can use your own implementation for the `ResultNameStrategy`\n\n```xml\n\u003cresultNameStrategy class=\"com.mycompany.jmxtrans.agent.MyResultNameStrategyImpl\"\u003e\n   \u003cattrA\u003evalA\u003c/attrA\u003e\n   \u003cattrB\u003evalB\u003c/attrB\u003e\n\u003c/resultNameStrategy\u003e\n```\n\nYou then have to make this implementation available in the classpath (adding it the the jmxtrans-agent jar, adding it to the boot classpath ...)\n\n## Sample configuration file\n\nSample `jmxtrans-agent.xml` configuration file for Tomcat:\n\n```xml\n\u003cjmxtrans-agent\u003e\n    \u003cqueries\u003e\n        \u003c!-- OS --\u003e\n        \u003cquery objectName=\"java.lang:type=OperatingSystem\" attribute=\"SystemLoadAverage\" resultAlias=\"os.systemLoadAverage\"/\u003e\n\n        \u003c!-- JVM --\u003e\n        \u003cquery objectName=\"java.lang:type=Memory\" attribute=\"HeapMemoryUsage\" key=\"used\"\n               resultAlias=\"jvm.heapMemoryUsage.used\"/\u003e\n        \u003cquery objectName=\"java.lang:type=Memory\" attribute=\"HeapMemoryUsage\" key=\"committed\"\n               resultAlias=\"jvm.heapMemoryUsage.committed\"/\u003e\n        \u003cquery objectName=\"java.lang:type=Memory\" attribute=\"NonHeapMemoryUsage\" key=\"used\"\n               resultAlias=\"jvm.nonHeapMemoryUsage.used\"/\u003e\n        \u003cquery objectName=\"java.lang:type=Memory\" attribute=\"NonHeapMemoryUsage\" key=\"committed\"\n               resultAlias=\"jvm.nonHeapMemoryUsage.committed\"/\u003e\n        \u003cquery objectName=\"java.lang:type=ClassLoading\" attribute=\"LoadedClassCount\" resultAlias=\"jvm.loadedClasses\"/\u003e\n\n        \u003cquery objectName=\"java.lang:type=Threading\" attribute=\"ThreadCount\" resultAlias=\"jvm.thread\"/\u003e\n\n        \u003c!-- TOMCAT --\u003e\n        \u003cquery objectName=\"Catalina:type=GlobalRequestProcessor,name=*\" attribute=\"requestCount\"\n               resultAlias=\"tomcat.requestCount\"/\u003e\n        \u003cquery objectName=\"Catalina:type=GlobalRequestProcessor,name=*\" attribute=\"errorCount\"\n               resultAlias=\"tomcat.errorCount\"/\u003e\n        \u003cquery objectName=\"Catalina:type=GlobalRequestProcessor,name=*\" attribute=\"processingTime\"\n               resultAlias=\"tomcat.processingTime\"/\u003e\n        \u003cquery objectName=\"Catalina:type=GlobalRequestProcessor,name=*\" attribute=\"bytesSent\"\n               resultAlias=\"tomcat.bytesSent\"/\u003e\n        \u003cquery objectName=\"Catalina:type=GlobalRequestProcessor,name=*\" attribute=\"bytesReceived\"\n               resultAlias=\"tomcat.bytesReceived\"/\u003e\n\n        \u003c!-- APPLICATION --\u003e\n        \u003cquery objectName=\"Catalina:type=Manager,context=/,host=localhost\" attribute=\"activeSessions\"\n               resultAlias=\"application.activeSessions\"/\u003e\n    \u003c/queries\u003e\n    \u003coutputWriter class=\"org.jmxtrans.agent.GraphitePlainTextTcpOutputWriter\"\u003e\n        \u003chost\u003elocalhost\u003c/host\u003e\n        \u003cport\u003e2003\u003c/port\u003e\n        \u003cnamePrefix\u003eapp_123456.servers.i876543.\u003c/namePrefix\u003e\n    \u003c/outputWriter\u003e\n    \u003coutputWriter class=\"org.jmxtrans.agent.ConsoleOutputWriter\"/\u003e\n    \u003ccollectIntervalInSeconds\u003e20\u003c/collectIntervalInSeconds\u003e\n\u003c/jmxtrans-agent\u003e\n```\n\n**Note** why XML and not JSON ? because XML parsing is out of the box in the JVM when JSON requires additional libraries.\n\n\n\n## OutputWriters\n\nOutputWriters are very simple to develop, you just have to extend [AbstractOutputWriter.java](https://github.com/jmxtrans/jmxtrans-agent/blob/master/src/main/java/org/jmxtrans/agent/AbstractOutputWriter.java) or to implement [OutputWriter.java](https://github.com/jmxtrans/jmxtrans-agent/blob/master/src/main/java/org/jmxtrans/agent/OutputWriter.java).\n\nOut of the box output writers:\n\n* [GraphitePlainTextTcpOutputWriter](https://github.com/jmxtrans/jmxtrans-agent/blob/master/src/main/java/org/jmxtrans/agent/GraphitePlainTextTcpOutputWriter.java): output to Graphite Carbon plain text protocol on TCP. Configuration parameters:\n  * `enabled`: to enable/disable the output writer. Optional, default value `true`\n  * `host`: Graphite Carbon listener host\n  * `port`: Graphite Carbon Plain Text TCP listener port. Optional, default value `2003`\n  * `namePrefix`; prefix of the metric name. Optional, default values `servers.#hostname#.` where `#hostname#` is the auto discovered hostname of computer with `.` escaped as `_` (`InetAddress.getLocalHost().getHostName()`).\n* [GraphiteUdpOutputWriter](https://github.com/jmxtrans/jmxtrans-agent/blob/master/src/main/java/org/jmxtrans/agent/GraphiteUdpOutputWriter.java): output to Graphite Carbon plain text protocol on UDP. Supports the same configuration parameters as the GraphitePlainTextTcpOutputWriter\n* [FileOverwriterOutputWriter](https://github.com/jmxtrans/jmxtrans-agent/blob/master/src/main/java/org/jmxtrans/agent/FileOverwriterOutputWriter.java): store the last collection of metrics in a file. Configuration parameters:\n  * `fileName`: name of the file in which the collected metrics are stored. Optional, default value `jmxtrans-agent.data` (in JVM working dir, for example `$TOMCAT_HOME/bin`)\n  * `showTimeStamp`: true or false value that determines if the time stamp is printed with the lines.  Optional tag, default is `false.\n* [SummarizingFileOverwriterOutputWriter](https://github.com/jmxtrans/jmxtrans-agent/blob/master/src/main/java/org/jmxtrans/agent/SummarizingFileOverwriterOutputWriter.java): Similar to the `FileOverwriterOutputWriter` but displays \"per minute\" values for counters of type `counter`\n* [ConsoleOutputWriter](https://github.com/jmxtrans/jmxtrans-agent/blob/master/src/main/java/org/jmxtrans/agent/ConsoleOutputWriter.java): output metric values to `stdout`\n* [SummarizingConsoleOutputWriter](https://github.com/jmxtrans/jmxtrans-agent/blob/master/src/main/java/org/jmxtrans/agent/SummarizingConsoleOutputWriter.java): Similar to the `ConsoleOutputWriter` but displays \"per minute\" values for counters of type `counter`\n* [RollingFileOutputWriter](https://github.com/jmxtrans/jmxtrans-agent/blob/master/src/main/java/org/jmxtrans/agent/RollingFileOutputWriter.java)\n  * `fileName`: Name of the file in which the collected metrics are stored. Optional, default value `jmxtrans-agent.data` (in JVM working dir, for example `$TOMCAT_HOME/bin`)\n  * `maxFileSize`: Maximum file size in MB before file is rolled. Optional, default is `10`\n  * `maxBackupIndex`: Maximum number of backup files. Optional, default is `5\n  * `singleLine`: true or false value that determines if all values are printed on a single line. Optional, default is false \n* [StatsDOutputWriter](https://github.com/jmxtrans/jmxtrans-agent/blob/master/src/main/java/org/jmxtrans/agent/StatsDOutputWriter.java): output to StatD using the counter metric type. Configuration parameters:\n  * `host`: StatsD listener host\n  * `port`: StatsD listener port\n  * `statsd` : Optional StatsD server type, statsd, dd or sysdig\n  * `tags` : Optional StatsD tags for dd and sysdig, i.e. serviceid:SERVICE_ID,environment:dev\n  * `metricName`: metric name prefix. Optional, default value is machine hostname or IP (all `.` are scaped as `_`).\n  * `bufferSize`: max buffer size. Holds data to be sent. Optional, default value is 1024.\n* [InfluxDbOutputWriter](https://github.com/jmxtrans/jmxtrans-agent/blob/master/src/main/java/org/jmxtrans/agent/influxdb/InfluxDbOutputWriter.java): output to InfluxDb. **This writer is currently experimental** - behavior and options might change. See [InfluxDbOutputWriter Details](#influxdboutputwriter-details) for more details. Configuration parameters:\n  * `url`: url to the influxdb server, e.g. `\u003curl\u003ehttp://influx.company.com:8086\u003c/url\u003e` - required\n  * `database`: name of the database to write to - required\n  * `user`: username for authentication - optional\n  * `password`: password for authentication - optional\n  * `tags`: additional tags to use for all metrics on `n1=v1,n2=v2` format, e.g. `\u003ctags\u003e#hostname#\u003c/tags\u003e` - optional\n  * `retentionPolicy`: retention policy to use - optional\n  * `connectTimeoutMillis`: connect timeout for the HTTP connection to influx - optional, defaults to 3000\n  * `readTimeoutMillis`: read timeout for the HTTP connection to influx - optional, defaults to 5000\n\n\nOutput writers configuration support an [expression language](https://github.com/jmxtrans/jmxtrans-agent/wiki/Expression-Language) based on property placeholders with the `{prop-name[:default-value]}` syntax (e.g. \"`${graphite.port:2003}`\").\n\nThe `default-value` is optional. An exception is raised if no default value is defined and the property placeholder is not found.\n\nEnvironment variables are looked-up in the following order:\n\n1. JVM system properties (```System.getProperty(\"graphite.host\")```)\n1. JVM environment variables (```System.getenv(\"graphite.host\")```)\n1. JVM environment variables after a \"to-upper-case + dot-to-underscore\" transformation (```System.getenv(\"GRAPHITE_HOST\")```)\n\n### InfluxDbOutputWriter Details\n\n**This writer is currently in beta, it might have bugs and the behavior and options might change**.\n\nWhen using the `InfluxDbOutputWriter`, the queries' `resultAlias` have special semantics. The result alias is a comma-separated list where the first\nitem is the name of the measurement and the rest of the items are tags to add to metrics collected by the query. For example, the query\n\n```xml\n\u003cquery objectName=\"java.lang:type=GarbageCollector,name=*\"\n\tattributes=\"CollectionTime,CollectionCount\"\n\tresultAlias=\"#attribute#,garbageCollector=%name%,myTag=foo\" /\u003e\n```\n\nwill result in measurements named as the attributes collected (`CollectionTime` and `CollectionCount`).\nThe additional tag `garbageCollector` will be added which will correspond to the\nname attribute of the object name. In addition, a tag called `myTag` with value `foo` will be added.\n\nAll measurements sent to InfluxDb will have only one field called `value`. Multiple fields are currently not supported.\n\nExample complete output writer configuration:\n\n```xml\n\u003coutputWriter class=\"org.jmxtrans.agent.influxdb.InfluxDbOutputWriter\"\u003e\n\t\u003curl\u003ehttp://localhost:8086\u003c/url\u003e\n\t\u003cdatabase\u003emydb\u003c/database\u003e\n\t\u003cuser\u003eadmin\u003c/user\u003e\n\t\u003cpassword\u003eshadow\u003c/password\u003e\n\t\u003ctags\u003ehost=#hostname#\u003c/tags\u003e\n\u003c/outputWriter\u003e\n```\n\n\n### Sample of ConsoleOutputWriter\n\n```\nos.systemLoadAverage 1.80419921875 1366199958\njvm.heapMemoryUsage.used 20438792 1366199958\njvm.heapMemoryUsage.committed 119668736 1366199958\njvm.nonHeapMemoryUsage.used 15953560 1366199958\njvm.nonHeapMemoryUsage.committed 24313856 1366199958\njvm.loadedClasses 2162 1366199958\njvm.thread 13 1366199958\ntomcat.requestCount 0 1366199958\ntomcat.requestCount 0 1366199958\ntomcat.errorCount 0 1366199958\ntomcat.errorCount 0 1366199958\ntomcat.processingTime 0 1366199958\ntomcat.processingTime 0 1366199958\ntomcat.bytesSent 0 1366199958\ntomcat.bytesSent 0 1366199958\ntomcat.bytesReceived 0 1366199958\ntomcat.bytesReceived 0 1366199958\napplication.activeSessions 0 1366199958\n```\n\n### Sample of FileOverwriterOutputWriter\n\n```\nos.systemLoadAverage 1.27734375\njvm.heapMemoryUsage.used 33436016\njvm.heapMemoryUsage.committed 133365760\njvm.nonHeapMemoryUsage.used 23623096\njvm.nonHeapMemoryUsage.committed 24707072\njvm.loadedClasses 3002\njvm.thread 21\ntomcat.requestCount 27\ntomcat.requestCount 0\ntomcat.errorCount 0\ntomcat.errorCount 0\ntomcat.processingTime 881\ntomcat.processingTime 0\ntomcat.bytesSent 135816\ntomcat.bytesSent 0\ntomcat.bytesReceived 0\ntomcat.bytesReceived 0\napplication.activeSessions 0\n```\n\n\n# Release Notes\n\n* [Milestones history](https://github.com/jmxtrans/jmxtrans-agent/milestones?state=closed)\n* [Releases](https://github.com/jmxtrans/jmxtrans-agent/releases)\n\n# Sample ActiveMQ Configuration\n\n* Create directory `${ACTIVEMQ_HOME}/jmxtrans-agent/`\n* Copy `jmxtrans-agent-1.2.4.jar` under `${ACTIVEMQ_HOME}/jmxtrans-agent/`\n* Update `${ACTIVEMQ_HOME}/bin/activemq`, add in `invoke_start()` and `invoke_console()`:\n\n```\nJMXTRANS_AGENT=\"-javaagent:${ACTIVEMQ_HOME}/jmxtrans-agent/jmxtrans-agent-1.2.4.jar=${ACTIVEMQ_HOME}/jmxtrans-agent/jmxtrans-agent-activemq.xml\"\nACTIVEMQ_OPTS=\"$ACTIVEMQ_OPTS $JMXTRANS_AGENT\"\n```\n\n* Copy to `${ACTIVEMQ_HOME}/jmxtrans-agent/` a config file similar to\n\n```xml\n\u003cjmxtrans-agent\u003e\n    \u003cqueries\u003e\n        \u003c!-- OS --\u003e\n        \u003cquery objectName=\"java.lang:type=OperatingSystem\" attribute=\"SystemLoadAverage\"\n               resultAlias=\"os.systemLoadAverage\"/\u003e\n\n        \u003c!-- JVM --\u003e\n        \u003cquery objectName=\"java.lang:type=Memory\" attribute=\"HeapMemoryUsage\" key=\"used\"\n               resultAlias=\"jvm.heapMemoryUsage.used\"/\u003e\n        \u003cquery objectName=\"java.lang:type=Memory\" attribute=\"HeapMemoryUsage\" key=\"committed\"\n               resultAlias=\"jvm.heapMemoryUsage.committed\"/\u003e\n        \u003cquery objectName=\"java.lang:type=Memory\" attribute=\"NonHeapMemoryUsage\" key=\"used\"\n               resultAlias=\"jvm.nonHeapMemoryUsage.used\"/\u003e\n        \u003cquery objectName=\"java.lang:type=Memory\" attribute=\"NonHeapMemoryUsage\" key=\"committed\"\n               resultAlias=\"jvm.nonHeapMemoryUsage.committed\"/\u003e\n        \u003cquery objectName=\"java.lang:type=ClassLoading\" attribute=\"LoadedClassCount\" resultAlias=\"jvm.loadedClasses\"/\u003e\n\n        \u003cquery objectName=\"java.lang:type=Threading\" attribute=\"ThreadCount\" resultAlias=\"jvm.thread\"/\u003e\n\n        \u003c!-- ACTIVE MQ --\u003e\n        \u003cquery objectName=\"org.apache.activemq:type=Broker,brokerName=*,destinationType=Queue,destinationName=*\"\n               attribute=\"QueueSize\" resultAlias=\"activemq.%brokerName%.queue.%destinationName%.QueueSize\"/\u003e\n        \u003cquery objectName=\"org.apache.activemq:type=Broker,brokerName=*,destinationType=Queue,destinationName=*\"\n               attribute=\"EnqueueCount\" resultAlias=\"activemq.%brokerName%.queue.%destinationName%.EnqueueCount\"/\u003e\n        \u003cquery objectName=\"org.apache.activemq:type=Broker,brokerName=*,destinationType=Queue,destinationName=*\"\n               attribute=\"ExpiredCount\" resultAlias=\"activemq.%brokerName%.queue.%destinationName%.ExpiredCount\"/\u003e\n        \u003cquery objectName=\"org.apache.activemq:type=Broker,brokerName=*,destinationType=Queue,destinationName=*\"\n               attribute=\"DequeueCount\" resultAlias=\"activemq.%brokerName%.queue.%destinationName%.DequeueCount\"/\u003e\n\n        \u003cquery objectName=\"org.apache.activemq:type=Broker,brokerName=*,destinationType=Topic,destinationName=*\"\n               attribute=\"EnqueueCount\" resultAlias=\"activemq.%brokerName%.topic.%destinationName%.EnqueueCount\"/\u003e\n    \u003c/queries\u003e\n    \u003coutputWriter class=\"org.jmxtrans.agent.GraphitePlainTextTcpOutputWriter\"\u003e\n        \u003chost\u003elocalhost\u003c/host\u003e\n        \u003cport\u003e2203\u003c/port\u003e\n    \u003c/outputWriter\u003e\n    \u003coutputWriter class=\"org.jmxtrans.agent.ConsoleOutputWriter\"\u003e\n        \u003cenabled\u003efalse\u003c/enabled\u003e\n    \u003c/outputWriter\u003e\n    \u003coutputWriter class=\"org.jmxtrans.agent.RollingFileOutputWriter\"\u003e\n      \u003cfileName\u003erollingJMXOutputFile\u003c/fileName\u003e\n      \u003cmaxFileSize\u003e10\u003c/maxFileSize\u003e\n      \u003cmaxBackupIndex\u003e4\u003c/maxBackupIndex\u003e\n   \u003c/outputWriter\u003e\n\u003c/jmxtrans-agent\u003e\n```\n\n# Release Notes\n\nSee https://github.com/jmxtrans/jmxtrans-agent/releases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmxtrans%2Fjmxtrans-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmxtrans%2Fjmxtrans-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmxtrans%2Fjmxtrans-agent/lists"}