Package io.prometheus.client.bridge
Class Graphite
java.lang.Object
io.prometheus.client.bridge.Graphite
Export metrics in the Graphite plaintext format.
Graphite g = new Graphite("localhost", 2003);
// Push the default registry once.
g.push(CollectorRegistry.defaultRegistry);
// Push the default registry every 60 seconds.
Thread thread = g.start(CollectorRegistry.defaultRegistry, 60);
// Stop pushing.
thread.interrupt();
thread.join();
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
push
(CollectorRegistry registry) Push samples from the given registry to Graphite.start
(CollectorRegistry registry) Push samples from the given registry to Graphite every minute.start
(CollectorRegistry registry, int intervalSeconds) Push samples from the given registry to Graphite at the given interval.
-
Field Details
-
logger
-
host
-
port
private final int port -
INVALID_GRAPHITE_CHARS
-
-
Constructor Details
-
Graphite
Construct a Graphite Bridge with the given host:port.
-
-
Method Details
-
push
Push samples from the given registry to Graphite.- Throws:
IOException
-
start
Push samples from the given registry to Graphite every minute. -
start
Push samples from the given registry to Graphite at the given interval.
-