Interface Observation.ContextView

All Known Implementing Classes:
Observation.Context, ObservedAspect.ObservedAspectContext, ReceiverContext, RequestReplyReceiverContext, RequestReplySenderContext, SenderContext
Enclosing interface:
Observation

public static interface Observation.ContextView
Read only view on the Observation.Context.
  • Method Details

    • getName

      String getName()
      The observation name.
      Returns:
      name
    • getContextualName

      @Nullable String getContextualName()
      Returns the contextual name. The name that makes sense within the current context (e.g. name derived from HTTP request).
      Returns:
      contextual name
    • getParentObservation

      @Nullable ObservationView getParentObservation()
      Returns the parent ObservationView.
      Returns:
      parent observation or null if there was no parent
    • getError

      @Nullable Throwable getError()
      Error that occurred while processing the Observation.
      Returns:
      error (null if there wasn't any)
    • get

      @Nullable <T> T get(Object key)
      Gets an entry from the context. Returns null when entry is not present.
      Type Parameters:
      T - value type
      Parameters:
      key - key
      Returns:
      entry or null if not present
    • getRequired

      @NonNull <T> T getRequired(Object key)
      Gets an entry from the context. Throws exception when entry is not present.
      Type Parameters:
      T - value type
      Parameters:
      key - key
      Returns:
      entry
      Throws:
      IllegalArgumentException - if not present
    • containsKey

      boolean containsKey(Object key)
      Checks if context contains a key.
      Parameters:
      key - key
      Returns:
      true when the context contains the entry with the given key
    • getOrDefault

      <T> T getOrDefault(Object key, T defaultObject)
      Returns an element or default if not present.
      Type Parameters:
      T - value type
      Parameters:
      key - key
      defaultObject - default object to return
      Returns:
      object or default if not present
    • getLowCardinalityKeyValues

      io.micrometer.common.KeyValues getLowCardinalityKeyValues()
      Returns low cardinality key values.
      Returns:
      low cardinality key values
    • getHighCardinalityKeyValues

      @NonNull io.micrometer.common.KeyValues getHighCardinalityKeyValues()
      Returns high cardinality key values.
      Returns:
      high cardinality key values
    • getLowCardinalityKeyValue

      @Nullable io.micrometer.common.KeyValue getLowCardinalityKeyValue(String key)
      Returns a low cardinality key value or null if not present.
      Parameters:
      key - key
      Returns:
      a low cardinality key value or null
    • getHighCardinalityKeyValue

      @Nullable io.micrometer.common.KeyValue getHighCardinalityKeyValue(String key)
      Returns a high cardinality key value or null if not present.
      Parameters:
      key - key
      Returns:
      a high cardinality key value or null
    • getAllKeyValues

      @NonNull io.micrometer.common.KeyValues getAllKeyValues()
      Returns all key values.
      Returns:
      all key values