public class PrometheusRSocketClient
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PrometheusRSocketClient.Builder |
| Modifier and Type | Method and Description |
|---|---|
static <M extends io.micrometer.core.instrument.MeterRegistry> |
build(M meterRegistry,
java.util.function.Supplier<java.lang.String> scrape,
io.rsocket.transport.ClientTransport clientTransport)
A generalization of
build(PrometheusMeterRegistry, ClientTransport) where you define the scrape function yourself. |
static PrometheusRSocketClient.Builder |
build(io.micrometer.prometheus.PrometheusMeterRegistry prometheusMeterRegistry,
io.rsocket.transport.ClientTransport clientTransport)
The most common case is that you want to both register proxy client metrics to a
PrometheusMeterRegistry and
also scrape from that registry. |
void |
close() |
void |
pushAndClose()
Pushes the data asynchronously (non-blocking) and closes the connection.
|
void |
pushAndCloseBlockingly()
Pushes the data in a blocking way and closes the connection.
|
void |
pushAndCloseBlockingly(java.time.Duration timeout)
Pushes the data in a blocking way and closes the connection.
|
public static PrometheusRSocketClient.Builder build(io.micrometer.prometheus.PrometheusMeterRegistry prometheusMeterRegistry, io.rsocket.transport.ClientTransport clientTransport)
PrometheusMeterRegistry and
also scrape from that registry.prometheusMeterRegistry - The registry to scrape metrics from and also publish client metrics to.clientTransport - The transport to connect to the proxy server with.public static <M extends io.micrometer.core.instrument.MeterRegistry> PrometheusRSocketClient.Builder build(M meterRegistry, java.util.function.Supplier<java.lang.String> scrape, io.rsocket.transport.ClientTransport clientTransport)
build(PrometheusMeterRegistry, ClientTransport) where you define the scrape function yourself.
This is useful when, for example, you want to concatenate scrapes from several PrometheusMeterRegistry instances,
perhaps each with different common tags for different parts of the application, and present these together as the scrape.M - The type of registry to publish client metrics to.meterRegistry - The registry to publish client metrics to.scrape - A scrape in the Prometheus format used.clientTransport - The transport to connect to the proxy server with.public void close()
public void pushAndCloseBlockingly()
public void pushAndCloseBlockingly(java.time.Duration timeout)
timeout - the amount of time to wait for the data to be sentpublic void pushAndClose()