Package io.micrometer.prometheus.rsocket
Class PrometheusRSocketClient
- java.lang.Object
-
- io.micrometer.prometheus.rsocket.PrometheusRSocketClient
-
public class PrometheusRSocketClient extends java.lang.ObjectEstablishes a persistent bidirectional RSocket connection to a Prometheus RSocket proxy. Prometheus scrapes each proxy instance. Proxies in turn use the connection to pull metrics from each client.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPrometheusRSocketClient.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PrometheusRSocketClient.Builderbuild(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 aPrometheusMeterRegistryand also scrape from that registry.static <M extends io.micrometer.core.instrument.MeterRegistry>
PrometheusRSocketClient.Builderbuild(M meterRegistry, java.util.function.Supplier<java.lang.String> scrape, io.rsocket.transport.ClientTransport clientTransport)A generalization ofbuild(PrometheusMeterRegistry, ClientTransport)where you define the scrape function yourself.voidclose()reactor.core.publisher.Mono<java.lang.Void>pushAndClose()
-
-
-
Method Detail
-
build
public 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 aPrometheusMeterRegistryand also scrape from that registry.- Parameters:
prometheusMeterRegistry- The registry to scrape metrics from and also publish client metrics to.clientTransport- The transport to connect to the proxy server with.- Returns:
- The client, connecting asynchronously at the point of return.
-
build
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)
A generalization ofbuild(PrometheusMeterRegistry, ClientTransport)where you define the scrape function yourself. This is useful when, for example, you want to concatenate scrapes from severalPrometheusMeterRegistryinstances, perhaps each with different common tags for different parts of the application, and present these together as the scrape.- Type Parameters:
M- The type of registry to publish client metrics to.- Parameters:
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.- Returns:
- The client, connecting asynchronously at the point of return.
-
close
public void close()
-
pushAndClose
public reactor.core.publisher.Mono<java.lang.Void> pushAndClose()
-
-