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 inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionSdkMetricsNettyClientFilter
(jakarta.inject.Provider<io.micrometer.core.instrument.MeterRegistry> meterRegistryProvider) -
Method Summary
Modifier and TypeMethodDescriptioncom.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
getOrder()
-
Field Details
-
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 interfaceOciNettyClientFilter<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 interfaceOciNettyClientFilter<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 fromOciNettyClientFilter.beforeRequest(HttpRequest)
- Returns:
- the http response
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceio.micronaut.core.order.Ordered
-