Class SdkMetricsNettyClientFilter

java.lang.Object
io.micronaut.oraclecloud.monitoring.sdk.SdkMetricsNettyClientFilter
All Implemented Interfaces:
io.micronaut.core.order.Ordered, OciNettyClientFilter<io.micrometer.core.instrument.Timer.Sample>

@Singleton @Requires(property="micronaut.metrics.enabled",notEquals="false",defaultValue="true") @Requires(property="micronaut.metrics.oci.sdk.client.enabled",notEquals="false",defaultValue="true") public class SdkMetricsNettyClientFilter extends Object implements OciNettyClientFilter<io.micrometer.core.instrument.Timer.Sample>
The SdkMetricsNettyClientFilter will emit oci sdk client metrics.
Since:
4.2.0
Author:
Nemanja Mikic
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    SdkMetricsNettyClientFilter(jakarta.inject.Provider<io.micrometer.core.instrument.MeterRegistry> meterRegistryProvider)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.oracle.bmc.http.client.HttpResponse
    afterResponse(@NonNull com.oracle.bmc.http.client.HttpRequest request, @Nullable com.oracle.bmc.http.client.HttpResponse response, @Nullable Throwable throwable, io.micrometer.core.instrument.Timer.Sample timerSample)
    The OCI SDK client will execute this method after it receives the response or exception is thrown.
    io.micrometer.core.instrument.Timer.Sample
    beforeRequest(@NonNull com.oracle.bmc.http.client.HttpRequest request)
    The OCI SDK client will execute this method before sending request.
    int
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MICRONAUT_METRICS_OCI_SDK_CLIENT_ENABLED

      public static final String MICRONAUT_METRICS_OCI_SDK_CLIENT_ENABLED
      See Also:
  • Constructor Details

    • SdkMetricsNettyClientFilter

      public SdkMetricsNettyClientFilter(jakarta.inject.Provider<io.micrometer.core.instrument.MeterRegistry> meterRegistryProvider)
  • Method Details

    • beforeRequest

      public io.micrometer.core.instrument.Timer.Sample beforeRequest(@NonNull @NonNull com.oracle.bmc.http.client.HttpRequest request)
      Description copied from interface: OciNettyClientFilter
      The OCI SDK client will execute this method before sending request.
      Specified by:
      beforeRequest in interface OciNettyClientFilter<io.micrometer.core.instrument.Timer.Sample>
      Parameters:
      request - the http requests.
      Returns:
      the data that will be passed to OciNettyClientFilter.afterResponse(HttpRequest, HttpResponse, Throwable, Object)
    • afterResponse

      public com.oracle.bmc.http.client.HttpResponse afterResponse(@NonNull @NonNull com.oracle.bmc.http.client.HttpRequest request, @Nullable @Nullable com.oracle.bmc.http.client.HttpResponse response, @Nullable @Nullable Throwable throwable, @NonNull io.micrometer.core.instrument.Timer.Sample timerSample)
      Description copied from interface: OciNettyClientFilter
      The OCI SDK client will execute this method after it receives the response or exception is thrown.
      Specified by:
      afterResponse in interface OciNettyClientFilter<io.micrometer.core.instrument.Timer.Sample>
      Parameters:
      request - the http requests.
      response - the http response.
      throwable - the exception that has been thrown during sending request and receiving response.
      timerSample - the data passed from OciNettyClientFilter.beforeRequest(HttpRequest)
      Returns:
      the http response
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface io.micronaut.core.order.Ordered