Class ElasticsearchObservationContext

java.lang.Object
io.micrometer.observation.Observation.Context
org.springframework.data.elasticsearch.client.elc.ElasticsearchObservationContext
All Implemented Interfaces:
io.micrometer.observation.Observation.ContextView

public class ElasticsearchObservationContext extends io.micrometer.observation.Observation.Context
Observation.Context for Spring Data Elasticsearch operations. One instance is created per observed operation. It carries contextual data that conventions use to produce observation names and key-values.
Since:
6.1
Author:
maryantocinn
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Integer
     
     
    @Nullable String
     
     
    void
    setBatchSize(@Nullable Integer batchSize)
    Set the number of operations included in a batch (bulk) request.

    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 Object

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

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

    getOrDefault
  • Constructor Details

  • Method Details

    • getOperationName

      public ElasticsearchOperationName getOperationName()
      Returns:
      the Spring Data operation being performed.
    • getIndexCoordinates

      public @Nullable IndexCoordinates getIndexCoordinates()
      Returns:
      the target index coordinates, or null if the operation is not index-specific.
    • getIndexName

      public @Nullable String getIndexName()
      Returns:
      the comma-joined index name(s), or null if no index coordinates are set.
    • getBatchSize

      public @Nullable Integer getBatchSize()
      Returns:
      the batch size, or null if not a batch operation.
    • setBatchSize

      public void setBatchSize(@Nullable Integer batchSize)
      Set the number of operations included in a batch (bulk) request.
      Parameters:
      batchSize - the batch size, can be null