Package org.apache.solr.metrics
Interface SolrMetricProducer
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
GpuMetricsProvider,SolrCache<K,,V> SolrInfoBean,SolrRequestHandler
- All Known Implementing Classes:
ActiveTasksListComponent,ActiveTasksListHandler,AnalysisRequestHandlerBase,AuditLoggerPlugin,AuthenticationPlugin,BasicAuthPlugin,CaffeineCache,CertAuthPlugin,CollectionsHandler,ConfigSetsHandler,ContentStreamHandlerBase,CoreAdminHandler,DebugComponent,DirectUpdateHandler2,DocumentAnalysisRequestHandler,DumpRequestHandler,ExactSharedStatsCache,ExactStatsCache,ExpandComponent,ExportHandler,FacetComponent,FacetModule,FieldAnalysisRequestHandler,GraphHandler,HealthCheckHandler,HighlightComponent,HttpShardHandlerFactory,InfoHandler,InstrumentedHttpListenerFactory,LocalStatsCache,LoggingHandler,LRUStatsCache,LukeRequestHandler,Metrics,MetricsHandler,MoreLikeThisComponent,MoreLikeThisHandler,MultiAuthPlugin,MultiDestinationAuditLogger,NotFoundRequestHandler,OverseerCollectionConfigSetProcessor,OverseerTaskProcessor,ParallelHttpShardHandlerFactory,PeerSync,PeerSyncWithLeader,PhrasesIdentificationComponent,PingRequestHandler,PKIAuthenticationPlugin,PropertiesRequestHandler,PublicKeyHandler,QueryCancellationComponent,QueryCancellationHandler,QueryComponent,QueryElevationComponent,RealTimeGetComponent,RealTimeGetHandler,ReplicationHandler,RequestHandlerBase,ResponseLogComponent,SchemaHandler,SearchComponent,SearchHandler,SecurityConfHandler,SecurityConfHandlerLocal,SecurityConfHandlerZk,SegmentsInfoRequestHandler,ShowFileRequestHandler,SolrConfigHandler,SolrCore,SolrFieldCacheBean,SolrIndexSearcher,SolrLogAuditLoggerPlugin,SpellCheckComponent,StandardRequestHandler,StatsCache,StatsComponent,StreamHandler,SuggestComponent,SyntheticSolrCore,SystemInfoHandler,TaggerRequestHandler,TaskManagementHandler,TermsComponent,TermVectorComponent,ThreadDumpHandler,UpdateHandler,UpdateLog,UpdateRequestHandler,UpdateShardHandler,V2UpdateRequestHandler,ZookeeperInfoHandler,ZookeeperStatusHandler
Used by objects that expose metrics through
SolrMetricManager.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final io.opentelemetry.api.common.AttributeKey<String> static final io.opentelemetry.api.common.AttributeKey<String> static final io.opentelemetry.api.common.AttributeKey<String> static final io.opentelemetry.api.common.AttributeKey<String> static final io.opentelemetry.api.common.AttributeKey<String> static final io.opentelemetry.api.common.AttributeKey<String> static final io.opentelemetry.api.common.AttributeKey<String> -
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Implementations should always callSolrMetricProducer.super.close()to ensure that metrics with the same life-cycle as this component are properly unregistered.Implementations should return the context used ininitializeMetrics(SolrMetricsContext, Attributes)to ensure proper cleanup of metrics at the end of the life-cycle of this component.static StringgetUniqueMetricTag(Object o, String parentName) Unique metric tag identifies components with the same life-cycle, which should be registered / unregistered together.voidinitializeMetrics(SolrMetricsContext parentContext, io.opentelemetry.api.common.Attributes attributes) Implementation should initialize all metrics to aSolrMetricsContextRegistry/MeterProvider withAttributesas the common set of attributes that will be attached to every metric that is initialized for that class/component
-
Field Details
-
TYPE_ATTR
-
CATEGORY_ATTR
-
HANDLER_ATTR
-
OPERATION_ATTR
-
RESULT_ATTR
-
NAME_ATTR
-
PLUGIN_NAME_ATTR
-
-
Method Details
-
getUniqueMetricTag
Unique metric tag identifies components with the same life-cycle, which should be registered / unregistered together. It is in the format of A:B:C, where A is the parent of B is the parent of C and so on. If object "B" is unregistered C also must get unregistered. If object "A" is unregistered B and C also must get unregistered.- Parameters:
o- object to create a tag forparentName- parent object name, or null if no parent exists
-
initializeMetrics
void initializeMetrics(SolrMetricsContext parentContext, io.opentelemetry.api.common.Attributes attributes) Implementation should initialize all metrics to aSolrMetricsContextRegistry/MeterProvider withAttributesas the common set of attributes that will be attached to every metric that is initialized for that class/component- Parameters:
parentContext- The registry that the component will initialize metrics toattributes- Base set of attributes that will be bound to all metrics for that component
-
getSolrMetricsContext
SolrMetricsContext getSolrMetricsContext()Implementations should return the context used ininitializeMetrics(SolrMetricsContext, Attributes)to ensure proper cleanup of metrics at the end of the life-cycle of this component. This should be the child context if one was created, or null if the parent context was used. -
close
Implementations should always callSolrMetricProducer.super.close()to ensure that metrics with the same life-cycle as this component are properly unregistered. This prevents obscure memory leaks.from: https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html While this interface method is declared to throw Exception, implementers are strongly encouraged to declare concrete implementations of the close method to throw more specific exceptions, or to throw no exception at all if the close operation cannot fail.
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-