Class OtelMetrics
java.lang.Object
org.apache.solr.crossdc.manager.consumer.OtelMetrics
- All Implemented Interfaces:
ConsumerMetrics
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.solr.crossdc.manager.consumer.ConsumerMetrics
ConsumerMetrics.ConsumerTimer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringprotected io.opentelemetry.api.metrics.LongCounterprotected io.opentelemetry.api.metrics.LongCounterprotected io.opentelemetry.api.metrics.LongCounterprotected static final Stringprotected SolrMetricManagerstatic final Stringprotected io.opentelemetry.api.metrics.LongCounterprotected io.opentelemetry.api.metrics.LongHistogramprotected io.opentelemetry.api.metrics.LongHistogramprotected io.opentelemetry.api.metrics.LongHistogramprotected io.opentelemetry.api.metrics.LongHistogramstatic final StringFields inherited from interface org.apache.solr.crossdc.manager.consumer.ConsumerMetrics
NOOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected io.opentelemetry.api.common.Attributesprotected io.opentelemetry.api.common.AttributesvoidIncrements the counter for collapsed "add" requests.voidincrementInputMsgCounter(long delta) Increments the counter for input messages.voidincrementInputReqCounter(String type, String subType, int delta) Increments the counter for input requests by type, subtype, and delta.voidincrementOutputCounter(String type, String result, int delta) Increments the counter for output requests by type, result, and delta.voidrecordOutputBackoffTime(MirroredSolrRequest.Type type, long backoffTimeMs) Records the backoff time for output requests.voidrecordOutputBatchSize(MirroredSolrRequest.Type type, org.apache.solr.client.solrj.SolrRequest<?> solrRequest) Records the batch size of the output request.voidrecordOutputFirstAttemptTime(MirroredSolrRequest.Type type, long firstAttemptTimeNs) Records the latency between the time when the message was sent at source and the time of the first attempt at processing.protected voidstartOutputTimeTimer(String requestType) Starts a timer to measure the duration of an output request processing by the given request type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.crossdc.manager.consumer.ConsumerMetrics
incrementInputMsgCounter, incrementInputReqCounter, incrementOutputCounter
-
Field Details
-
REGISTRY
- See Also:
-
NAME_PREFIX
- See Also:
-
ATTR_TYPE
- See Also:
-
ATTR_SUBTYPE
- See Also:
-
ATTR_RESULT
- See Also:
-
attributesCache
-
metricManager
-
inputMsg
protected io.opentelemetry.api.metrics.LongCounter inputMsg -
inputReq
protected io.opentelemetry.api.metrics.LongCounter inputReq -
collapsed
protected io.opentelemetry.api.metrics.LongCounter collapsed -
output
protected io.opentelemetry.api.metrics.LongCounter output -
outputBatchSizeHistogram
protected io.opentelemetry.api.metrics.LongHistogram outputBatchSizeHistogram -
outputTimeHistogram
protected io.opentelemetry.api.metrics.LongHistogram outputTimeHistogram -
outputBackoffHistogram
protected io.opentelemetry.api.metrics.LongHistogram outputBackoffHistogram -
outputFirstAttemptHistogram
protected io.opentelemetry.api.metrics.LongHistogram outputFirstAttemptHistogram -
KEY_SEPARATOR
- See Also:
-
-
Constructor Details
-
OtelMetrics
public OtelMetrics()
-
-
Method Details
-
register
-
attr
-
attr
-
getMetricManager
-
incrementCollapsedCounter
public void incrementCollapsedCounter()Description copied from interface:ConsumerMetricsIncrements the counter for collapsed "add" requests.- Specified by:
incrementCollapsedCounterin interfaceConsumerMetrics
-
incrementInputMsgCounter
public void incrementInputMsgCounter(long delta) Description copied from interface:ConsumerMetricsIncrements the counter for input messages.- Specified by:
incrementInputMsgCounterin interfaceConsumerMetrics- Parameters:
delta- increase the counter by this value
-
incrementInputReqCounter
Description copied from interface:ConsumerMetricsIncrements the counter for input requests by type, subtype, and delta.- Specified by:
incrementInputReqCounterin interfaceConsumerMetrics- Parameters:
type- request type, one ofMirroredSolrRequest.Typevalues.subType- additional subtype: add, delete_by_id, delete_by_query, or action for other request types.delta- increase the counter by this value
-
incrementOutputCounter
Description copied from interface:ConsumerMetricsIncrements the counter for output requests by type, result, and delta.- Specified by:
incrementOutputCounterin interfaceConsumerMetrics- Parameters:
type- the type of the requestresult- the result of the request, such as success or failuredelta- the value by which the counter should be increased
-
recordOutputBatchSize
public void recordOutputBatchSize(MirroredSolrRequest.Type type, org.apache.solr.client.solrj.SolrRequest<?> solrRequest) Description copied from interface:ConsumerMetricsRecords the batch size of the output request. Batch size is defined as the number of operations in an outputSolrRequest(which may be different from the input size due to collapsing).- Specified by:
recordOutputBatchSizein interfaceConsumerMetrics- Parameters:
type- the type of the request, corresponding to one of theMirroredSolrRequest.getType()valuessolrRequest- SolrRequest object for which the batch size is being recorded
-
recordOutputBackoffTime
Description copied from interface:ConsumerMetricsRecords the backoff time for output requests. Backoff time represents the delay before the next retry for the specified request type.- Specified by:
recordOutputBackoffTimein interfaceConsumerMetrics- Parameters:
type- the type of the request, corresponding to one of theMirroredSolrRequest.getType()values.backoffTimeMs- the backoff time in milliseconds.
-
recordOutputFirstAttemptTime
Description copied from interface:ConsumerMetricsRecords the latency between the time when the message was sent at source and the time of the first attempt at processing.- Specified by:
recordOutputFirstAttemptTimein interfaceConsumerMetrics- Parameters:
type- the type of the request, corresponding to one of theMirroredSolrRequest.getType()valuesfirstAttemptTimeNs- the latency of the first attempt in milliseconds.
-
startOutputTimeTimer
Description copied from interface:ConsumerMetricsStarts a timer to measure the duration of an output request processing by the given request type.- Specified by:
startOutputTimeTimerin interfaceConsumerMetrics- Parameters:
requestType- the type of the request for which the timer is started- Returns:
- a
ConsumerMetrics.ConsumerTimerthat allows to measure the elapsed time
-