Class PrometheusRSocketClient


  • public class PrometheusRSocketClient
    extends java.lang.Object
    Establishes 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.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      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 of build(PrometheusMeterRegistry, ClientTransport) where you define the scrape function yourself.
      void close()  
      reactor.core.publisher.Mono<java.lang.Void> pushAndClose()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 a PrometheusMeterRegistry and 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 of 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.
        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()