michaelandrepearce commented on a change in pull request #2681: ARTEMIS-2308 
Support exporting metrics
URL: https://github.com/apache/activemq-artemis/pull/2681#discussion_r288855317
 
 

 ##########
 File path: docs/user-manual/en/metrics.md
 ##########
 @@ -0,0 +1,105 @@
+# Metrics
+
+Apache ActiveMQ Artemis can export metrics to a variety of monitoring systems
+via the [Micrometer](https://micrometer.io/) vendor-neutral application metrics
+facade.
+
+Important runtime metrics have been instrumented via the Micrometer API, and
+all a user needs to do is implement 
`org.apache.activemq.artemis.core.server.metrics.ActiveMQMetricsPlugin`
+in order to instantiate and configure a 
`io.micrometer.core.instrument.MeterRegistry`
+implementation. Relevant implementations of `MeterRegistry` are available from
+the [Micrometer 
code-base](https://github.com/micrometer-metrics/micrometer/tree/master/implementations).
+
+This is a simple interface:
+
+```java
+public interface ActiveMQMetricsPlugin extends Serializable {
+
+   ActiveMQMetricsPlugin init(Map<String, String> options);
+
+   MeterRegistry getRegistry();
+}
+```
+
+When the broker starts it will call `init` and pass in the `options` which can
+be specified in XML as key/value properties. At this point the plugin should
+instantiate and configure the `io.micrometer.core.instrument.MeterRegistry`
+implementation.
+
+Later during the broker startup process it will call `getRegistry` in order to
+get the `MeterRegistry` implementation and use it for registering meters.
+
+The broker ships with two `ActiveMQMetricsPlugin` implementations:
+
+- 
`org.apache.activemq.artemis.core.server.metrics.plugins.LoggingMetricsPlugin`
+  This plugin simply logs metrics. It's not very useful for production, but can
+  serve as a demonstration of the Micrometer integration. It takes no key/value
+  properties for configuration.
+
+- `org.apache.activemq.artemis.core.server.metrics.plugins.SimpleMetricsPlugin`
+  This plugin is used for testing. It is in-memory only and provides no 
external
+  output. It takes no key/value properties for configuration.
+
+## Metrics
+
+The following metrics are exported, categorized by component. A description for
+each metric is exported along with the metric itself therefore the description
+will not be repeated here.
+
+**Broker**
+
+- connection.count
+- total.connection.count
+- address.memory.usage
+
+**Address**
+
+- routed.message.count
+- unrouted.message.count
 
 Review comment:
   @jbertram what about paging size? This is quite important thing to watch out 
for.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to