Package io.prometheus.client.bridge
Class Graphite
- java.lang.Object
-
- io.prometheus.client.bridge.Graphite
-
public class Graphite extends java.lang.ObjectExport 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 Modifier and Type Class Description private classGraphite.PushThread
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringhostprivate static java.util.regex.PatternINVALID_GRAPHITE_CHARSprivate static java.util.logging.Loggerloggerprivate intport
-
Constructor Summary
Constructors Constructor Description Graphite(java.lang.String host, int port)Construct a Graphite Bridge with the given host:port.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpush(CollectorRegistry registry)Push samples from the given registry to Graphite.java.lang.Threadstart(CollectorRegistry registry)Push samples from the given registry to Graphite every minute.java.lang.Threadstart(CollectorRegistry registry, int intervalSeconds)Push samples from the given registry to Graphite at the given interval.
-
-
-
Method Detail
-
push
public void push(CollectorRegistry registry) throws java.io.IOException
Push samples from the given registry to Graphite.- Throws:
java.io.IOException
-
start
public java.lang.Thread start(CollectorRegistry registry)
Push samples from the given registry to Graphite every minute.
-
start
public java.lang.Thread start(CollectorRegistry registry, int intervalSeconds)
Push samples from the given registry to Graphite at the given interval.
-
-