Class OkHttpContext

java.lang.Object
io.micrometer.observation.Observation.Context
io.micrometer.observation.transport.SenderContext<okhttp3.Request.Builder>
io.micrometer.observation.transport.RequestReplySenderContext<okhttp3.Request.Builder,okhttp3.Response>
io.micrometer.core.instrument.binder.okhttp3.OkHttpContext
All Implemented Interfaces:
io.micrometer.observation.Observation.ContextView, io.micrometer.observation.transport.ResponseContext<okhttp3.Response>, Supplier<OkHttpContext>

public class OkHttpContext extends io.micrometer.observation.transport.RequestReplySenderContext<okhttp3.Request.Builder,okhttp3.Response> implements Supplier<OkHttpContext>
A SenderContext for OkHttp3.
Since:
1.10.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    OkHttpContext(Function<okhttp3.Request,String> urlMapper, Iterable<io.micrometer.common.KeyValue> extraTags, Iterable<BiFunction<okhttp3.Request,okhttp3.Response,io.micrometer.common.KeyValue>> contextSpecificTags, Iterable<io.micrometer.common.KeyValue> unknownRequestTags, boolean includeHostTag, okhttp3.Request originalRequest)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
     
    Iterable<BiFunction<okhttp3.Request,okhttp3.Response,io.micrometer.common.KeyValue>>
     
    Iterable<io.micrometer.common.KeyValue>
     
    okhttp3.Request
     
    io.micrometer.core.instrument.binder.okhttp3.OkHttpObservationInterceptor.CallState
     
    Iterable<io.micrometer.common.KeyValue>
     
    Function<okhttp3.Request,String>
     
    boolean
     
    void
    setState(io.micrometer.core.instrument.binder.okhttp3.OkHttpObservationInterceptor.CallState state)
     

    Methods inherited from class io.micrometer.observation.transport.RequestReplySenderContext

    getResponse, setResponse

    Methods inherited from class io.micrometer.observation.transport.SenderContext

    getCarrier, getKind, getRemoteServiceAddress, getRemoteServiceName, getSetter, setCarrier, setRemoteServiceAddress, setRemoteServiceName

    Methods inherited from class io.micrometer.observation.Observation.Context

    addHighCardinalityKeyValue, addHighCardinalityKeyValues, addLowCardinalityKeyValue, addLowCardinalityKeyValues, clear, computeIfAbsent, containsKey, get, getAllKeyValues, getContextualName, getError, getHighCardinalityKeyValue, getHighCardinalityKeyValues, getLowCardinalityKeyValue, getLowCardinalityKeyValues, getName, getOrDefault, getParentObservation, getRequired, put, remove, removeHighCardinalityKeyValue, removeHighCardinalityKeyValues, removeLowCardinalityKeyValue, removeLowCardinalityKeyValues, setContextualName, setError, setName, setParentObservation, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.micrometer.observation.Observation.ContextView

    getOrDefault
  • Constructor Details

    • OkHttpContext

      public OkHttpContext(Function<okhttp3.Request,String> urlMapper, Iterable<io.micrometer.common.KeyValue> extraTags, Iterable<BiFunction<okhttp3.Request,okhttp3.Response,io.micrometer.common.KeyValue>> contextSpecificTags, Iterable<io.micrometer.common.KeyValue> unknownRequestTags, boolean includeHostTag, okhttp3.Request originalRequest)
  • Method Details

    • setState

      public void setState(io.micrometer.core.instrument.binder.okhttp3.OkHttpObservationInterceptor.CallState state)
    • getState

      public io.micrometer.core.instrument.binder.okhttp3.OkHttpObservationInterceptor.CallState getState()
    • getUrlMapper

      public Function<okhttp3.Request,String> getUrlMapper()
    • getExtraTags

      public Iterable<io.micrometer.common.KeyValue> getExtraTags()
    • getContextSpecificTags

      public Iterable<BiFunction<okhttp3.Request,okhttp3.Response,io.micrometer.common.KeyValue>> getContextSpecificTags()
    • getUnknownRequestTags

      public Iterable<io.micrometer.common.KeyValue> getUnknownRequestTags()
    • isIncludeHostTag

      public boolean isIncludeHostTag()
    • getOriginalRequest

      public okhttp3.Request getOriginalRequest()
    • get

      public OkHttpContext get()
      Specified by:
      get in interface Supplier<OkHttpContext>