Gemfire JavaDocs_test
Interface MetricsPublishingService
-
@Experimental("Micrometer metrics is a new addition to Geode and the API may change") public interface MetricsPublishingService
Publishes metrics managed by aMetricsSession
.Geode discovers
MetricsPublishingService
s during system creation, using the standard JavaServiceLoader
mechanism:package com.application; public class MyMetricsPublishingService implements MetricsPublishingService { private volatile MeterRegistry registry; private volatile MetricsSession session; @Override public void start(MetricsSession session) { this.session = session; registry = ... // configure your meter registry and start publishing // add your registry as a sub-registry to the session session.addSubregistry(registry); } @Override public void stop() { ... // clean up any resources used by your meter registry ... session.removeSubregistry(registry); } }
To make your service available for loading, add the following provider-configuration file in the resource directory of your application Jar:
META-INF/services/org.apache.geode.metrics.MetricsPublishingService
Add a line inside the file indicating the fully qualified class name of your implementation:
com.application.MyMetricsPublishingService
Experimental: Micrometer metrics is a new addition to Geode and the API may change.
- See Also:
- Micrometer Documentation, Micrometer Concepts
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Optional<java.net.URL>
getUrl()
void
start(MetricsSession session)
Invoked when a metrics session starts.void
stop(MetricsSession session)
Invoked when a metrics session stops.
-
-
-
Method Detail
-
start
void start(MetricsSession session)
Invoked when a metrics session starts. A typical implementation will create a meter registry that can publish to an external monitoring system, and callMetricsSession.addSubregistry(MeterRegistry)
to add that registry to the session.- Parameters:
session
- the metrics session whose metrics this publishing service will publish
-
stop
void stop(MetricsSession session)
Invoked when a metrics session stops. The implementation should callMetricsSession.removeSubregistry(MeterRegistry)
to remove each meter registry it added to the session. The implementation should also clean up any other resources it allocated during- Parameters:
session
- the metrics session whose metrics this publishing service was publishingstart(MetricsSession)
.
-
getUrl
default java.util.Optional<java.net.URL> getUrl()
-
-