Class SolrClusterReporter
- java.lang.Object
-
- org.apache.solr.metrics.SolrMetricReporter
-
- org.apache.solr.metrics.SolrCoreContainerReporter
-
- org.apache.solr.metrics.reporters.solr.SolrClusterReporter
-
- All Implemented Interfaces:
Closeable,AutoCloseable,PluginInfoInitialized
public class SolrClusterReporter extends SolrCoreContainerReporter
This reporter sends selected metrics from local registries toOverseer.The following configuration properties are supported:
- handler - (optional str) handler path where reports are sent. Default is
MetricsCollectorHandler.HANDLER_PATH. - period - (optional int) how often reports are sent, in seconds. Default is 60. Setting this to 0 disables the reporter.
- report - (optional multiple lst) report configuration(s), see below.
- registry - (required str) regex pattern matching source registries (see
SolrMetricManager.registryNames(String...)), may contain capture groups. - group - (required str) target registry name where metrics will be grouped. This can be a regex pattern that
contains back-references to capture groups collected by
registrypattern - label - (optional str) optional prefix to prepend to metric names, may contain back-references to
capture groups collected by
registrypattern - filter - (optional multiple str) regex expression(s) matching selected metrics to be reported.
DEFAULT_REPORTS.Example configuration:
<reporter name="test" group="cluster" class="solr.SolrClusterReporter"> <str name="handler">/admin/metrics/collector</str> <int name="period">11</int> <lst name="report"> <str name="group">overseer</str> <str name="label">jvm</str> <str name="registry">solr\.jvm</str> <str name="filter">memory\.total\..*</str> <str name="filter">memory\.heap\..*</str> <str name="filter">os\.SystemLoadAverage</str> <str name="filter">threads\.count</str> </lst> <lst name="report"> <str name="group">overseer</str> <str name="label">leader.$1</str> <str name="registry">solr\.core\.(.*)\.leader</str> <str name="filter">UPDATE\./update/.*</str> </lst> </reporter>
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLUSTER_GROUPstatic List<SolrReporter.Report>DEFAULT_REPORTS-
Fields inherited from class org.apache.solr.metrics.SolrCoreContainerReporter
coreContainer
-
Fields inherited from class org.apache.solr.metrics.SolrMetricReporter
enabled, metricManager, period, pluginInfo, registryName
-
-
Constructor Summary
Constructors Constructor Description SolrClusterReporter(SolrMetricManager metricManager, String registryName)Create a reporter for metrics managed in a named registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voiddoInit()Reporter initialization implementation.voidinit(PluginInfo pluginInfo, CoreContainer cc)voidsetHandler(String handler)voidsetReport(List<Map> reportConfig)voidsetReport(Map map)protected voidvalidate()Validates that the reporter has been correctly configured.-
Methods inherited from class org.apache.solr.metrics.SolrCoreContainerReporter
getCoreContainer, init
-
Methods inherited from class org.apache.solr.metrics.SolrMetricReporter
getPeriod, getPluginInfo, setEnabled, setPeriod, toString
-
-
-
-
Field Detail
-
CLUSTER_GROUP
public static final String CLUSTER_GROUP
-
DEFAULT_REPORTS
public static final List<SolrReporter.Report> DEFAULT_REPORTS
-
-
Constructor Detail
-
SolrClusterReporter
public SolrClusterReporter(SolrMetricManager metricManager, String registryName)
Create a reporter for metrics managed in a named registry.- Parameters:
metricManager- metric managerregistryName- this is ignored
-
-
Method Detail
-
setHandler
public void setHandler(String handler)
-
setReport
public void setReport(Map map)
-
doInit
protected void doInit()
Description copied from class:SolrMetricReporterReporter initialization implementation.- Specified by:
doInitin classSolrMetricReporter
-
validate
protected void validate() throws IllegalStateExceptionDescription copied from class:SolrMetricReporterValidates that the reporter has been correctly configured.- Specified by:
validatein classSolrMetricReporter- Throws:
IllegalStateException- if the reporter is not properly configured
-
close
public void close() throws IOException- Throws:
IOException
-
init
public void init(PluginInfo pluginInfo, CoreContainer cc)
- Overrides:
initin classSolrCoreContainerReporter
-
-