Class LoggingMetrics

java.lang.Object
ch.admin.bag.covidcertificate.log.metrics.LoggingMetrics

@Component
public class LoggingMetrics
extends Object
Records logging metrics using a LoggingMetricsProvider (using Micrometer if available, otherwise NOP)
Is initialized after the application has successfully started to avoid race conditions in auto config initialization between micrometer and logging. Does not statically link to micrometer to avoid a hard dependency on micrometer.
Buffers counter increments locally until a metrics provider has been initialized to avoid losing counters when micrometer is not yet initialized.
  • Constructor Details

    • LoggingMetrics

      public LoggingMetrics()
  • Method Details

    • onApplicationStartedEvent

      @EventListener public void onApplicationStartedEvent​(org.springframework.boot.context.event.ApplicationStartedEvent event)
    • incrementAsyncBufferFullFallback

      public static void incrementAsyncBufferFullFallback()
    • incrementDistributedLogConnectionEstablished

      public static void incrementDistributedLogConnectionEstablished()
    • incrementDistributedLogConnectionError

      public static void incrementDistributedLogConnectionError()
    • incrementDistributedLogTransmitError

      public static void incrementDistributedLogTransmitError()
    • incrementDistributedLogFallback

      public static void incrementDistributedLogFallback()
    • distributedLogTransmitTime

      public static void distributedLogTransmitTime​(java.time.Duration duration)