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
ConstructorsConstructorDescriptionElasticsearchObservationContext(ElasticsearchOperationName operationName, @Nullable IndexCoordinates indexCoordinates) -
Method Summary
Modifier and TypeMethodDescription@Nullable Integer@Nullable IndexCoordinates@Nullable StringvoidsetBatchSize(@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, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micrometer.observation.Observation.ContextView
getOrDefault
-
Constructor Details
-
ElasticsearchObservationContext
public ElasticsearchObservationContext(ElasticsearchOperationName operationName, @Nullable IndexCoordinates indexCoordinates)
-
-
Method Details
-
getOperationName
- Returns:
- the Spring Data operation being performed.
-
getIndexCoordinates
- Returns:
- the target index coordinates, or null if the operation is not index-specific.
-
getIndexName
- Returns:
- the comma-joined index name(s), or null if no index coordinates are set.
-
getBatchSize
- Returns:
- the batch size, or null if not a batch operation.
-
setBatchSize
Set the number of operations included in a batch (bulk) request.- Parameters:
batchSize- the batch size, can be null
-