This PR adds a Micrometer-based metrics system to Geode. On startup, Geode configures a "primary" meter registry. Developers use the primary registry to create meters (gauges, counters, timers, and others) to instrument Geode and client code.
Internally, the meter registry is a "composite" registry, which allows attaching any number of "downstream" registries. Each downstream registry will typically publish the metrics to an external monitoring system, or provide an endpoint where an external monitoring system can "scrape" the metrics. In Geode, when a meter is added or removed from the primary registry, the primary registry adds or removes a corresponding meter in each downstream registry. When a meter in the primary registry is updated (e.g. incremented), the primary registry forwards each operation to the corresponding meter in each downstream registry. A MetricsCollector provides access to the primary registry, and includes methods for adding and removing downstream registries. The MetricsCollector itself is currently available via a method on InternalDistributedSystem. Eventually we plan to make the MetricsCollector available through DistributedSystem, or some other non-internal class or interface. The key components of this change are: - MetricsCollector (interface) allows access to the primary registry, and allows adding and removing downstream registries. - CompositeMetricsCollector is the concrete implementation of MetricsCollector, and creates the internal composite registry. - InternalDistributedSystem creates the MetricsCollector and makes it available via a new getMetricsCollector() method. - The Micrometer system for instrumenting and maintaining metrics (added to Geode as a dependency). See http://micrometer.io/ for details. Thank you for submitting a contribution to Apache Geode. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: ### For all changes: - [X] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? - [X] Has your PR been rebased against the latest commit within the target branch (typically `develop`)? - [X] Is your initial contribution a single, squashed commit? - [X] Does `gradlew build` run cleanly? - [X] Have you written or updated unit tests to verify your changes? - [X] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? ### Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. If you need help, please send an email to [email protected]. [ Full content available at: https://github.com/apache/geode/pull/3153 ] This message was relayed via gitbox.apache.org for [email protected]
