Class SolrPrometheusFormatter
- java.lang.Object
- 
- org.apache.solr.metrics.prometheus.SolrPrometheusFormatter
 
- 
- Direct Known Subclasses:
- SolrPrometheusCoreFormatter,- SolrPrometheusJettyFormatter,- SolrPrometheusJvmFormatter,- SolrPrometheusNodeFormatter
 
 public abstract class SolrPrometheusFormatter extends Object Base class for allSolrPrometheusFormatterholdingMetricSnapshots. Can exportMetrictoMetricSnapshotto be outputted forPrometheusResponseWriter
- 
- 
Field SummaryFields Modifier and Type Field Description protected Map<String,List<io.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshot>>metricCountersprotected Map<String,List<io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot>>metricGauges
 - 
Constructor SummaryConstructors Constructor Description SolrPrometheusFormatter()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract SolrMetriccategorizeMetric(com.codahale.metrics.Metric dropwizardMetric, String metricName)CategorizeMetricbased on the metric nameio.prometheus.metrics.model.snapshots.MetricSnapshotscollect()Returns an immutableMetricSnapshotsfrom theDataPointSnapshots collected from the registryvoidcollectCounterDatapoint(String metricName, io.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshot dataPoint)CollectsCounterSnapshot.CounterDataPointSnapshotand appends to existing metric or create new metric if name does not existvoidcollectGaugeDatapoint(String metricName, io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot dataPoint)CollectsGaugeSnapshot.GaugeDataPointSnapshotand appends to existing metric or create new metric if name does not existio.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshotcreateCounterDatapoint(double value, io.prometheus.metrics.model.snapshots.Labels labels)Create aCounterSnapshot.CounterDataPointSnapshotwith labelsio.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshotcreateGaugeDatapoint(double value, io.prometheus.metrics.model.snapshots.Labels labels)Create aGaugeSnapshot.GaugeDataPointSnapshotwith labelsvoidexportCounter(String metricName, com.codahale.metrics.Counter dropwizardMetric, io.prometheus.metrics.model.snapshots.Labels labels)ExportCountertoCounterSnapshot.CounterDataPointSnapshotand collect datapointabstract voidexportDropwizardMetric(com.codahale.metrics.Metric dropwizardMetric, String metricName)ExportMetrictoMetricSnapshotand register the SnapshotvoidexportGauge(String metricName, com.codahale.metrics.Gauge<?> dropwizardMetricRaw, io.prometheus.metrics.model.snapshots.Labels labels)ExportGaugetoGaugeSnapshot.GaugeDataPointSnapshotand collect to datapoint.voidexportMeter(String metricName, com.codahale.metrics.Meter dropwizardMetric, io.prometheus.metrics.model.snapshots.Labels labels)ExportMetertoCounterSnapshot.CounterDataPointSnapshotand collect datapointvoidexportTimer(String metricName, com.codahale.metrics.Timer dropwizardMetric, io.prometheus.metrics.model.snapshots.Labels labels)ExportTimerands its mean rate toGaugeSnapshot.GaugeDataPointSnapshotand collect datapointvoidexportTimerCount(String metricName, com.codahale.metrics.Timer dropwizardMetric, io.prometheus.metrics.model.snapshots.Labels labels)ExportTimerands its Count toCounterSnapshot.CounterDataPointSnapshotand collect datapoint
 
- 
- 
- 
Method Detail- 
exportDropwizardMetricpublic abstract void exportDropwizardMetric(com.codahale.metrics.Metric dropwizardMetric, String metricName)ExportMetrictoMetricSnapshotand register the Snapshot- Parameters:
- dropwizardMetric- the- Metricto be exported
- metricName- Dropwizard metric name
 
 - 
categorizeMetricpublic abstract SolrMetric categorizeMetric(com.codahale.metrics.Metric dropwizardMetric, String metricName) CategorizeMetricbased on the metric name- Parameters:
- dropwizardMetric- the- Metricto be exported
- metricName- Dropwizard metric name
 
 - 
exportMeterpublic void exportMeter(String metricName, com.codahale.metrics.Meter dropwizardMetric, io.prometheus.metrics.model.snapshots.Labels labels) ExportMetertoCounterSnapshot.CounterDataPointSnapshotand collect datapoint- Parameters:
- metricName- name of metric after export
- dropwizardMetric- the- Meterto be exported
- labels- label names and values to record
 
 - 
exportCounterpublic void exportCounter(String metricName, com.codahale.metrics.Counter dropwizardMetric, io.prometheus.metrics.model.snapshots.Labels labels) ExportCountertoCounterSnapshot.CounterDataPointSnapshotand collect datapoint- Parameters:
- metricName- name of prometheus metric
- dropwizardMetric- the- Counterto be exported
- labels- label names and values to record
 
 - 
exportTimerpublic void exportTimer(String metricName, com.codahale.metrics.Timer dropwizardMetric, io.prometheus.metrics.model.snapshots.Labels labels) ExportTimerands its mean rate toGaugeSnapshot.GaugeDataPointSnapshotand collect datapoint- Parameters:
- metricName- name of prometheus metric
- dropwizardMetric- the- Timerto be exported
- labels- label names and values to record
 
 - 
exportTimerCountpublic void exportTimerCount(String metricName, com.codahale.metrics.Timer dropwizardMetric, io.prometheus.metrics.model.snapshots.Labels labels) ExportTimerands its Count toCounterSnapshot.CounterDataPointSnapshotand collect datapoint- Parameters:
- metricName- name of prometheus metric
- dropwizardMetric- the- Timerto be exported
- labels- label names and values to record
 
 - 
exportGaugepublic void exportGauge(String metricName, com.codahale.metrics.Gauge<?> dropwizardMetricRaw, io.prometheus.metrics.model.snapshots.Labels labels) ExportGaugetoGaugeSnapshot.GaugeDataPointSnapshotand collect to datapoint. Unlike other Dropwizard metric types, Gauges can have more complex types. In the case of a hashmap, collect each as an individual metric and have its key appended as a label to the metric called "item"- Parameters:
- metricName- name of prometheus metric
- dropwizardMetricRaw- the- Gaugeto be exported
- labels- label names and values to record
 
 - 
createCounterDatapointpublic io.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshot createCounterDatapoint(double value, io.prometheus.metrics.model.snapshots.Labels labels)Create aCounterSnapshot.CounterDataPointSnapshotwith labels- Parameters:
- value- metric value
- labels- set of name/values labels
 
 - 
createGaugeDatapointpublic io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot createGaugeDatapoint(double value, io.prometheus.metrics.model.snapshots.Labels labels)Create aGaugeSnapshot.GaugeDataPointSnapshotwith labels- Parameters:
- value- metric value
- labels- set of name/values labels
 
 - 
collectCounterDatapointpublic void collectCounterDatapoint(String metricName, io.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshot dataPoint) CollectsCounterSnapshot.CounterDataPointSnapshotand appends to existing metric or create new metric if name does not exist- Parameters:
- metricName- Name of metric
- dataPoint- Counter datapoint to be collected
 
 - 
collectGaugeDatapointpublic void collectGaugeDatapoint(String metricName, io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot dataPoint) CollectsGaugeSnapshot.GaugeDataPointSnapshotand appends to existing metric or create new metric if name does not exist- Parameters:
- metricName- Name of metric
- dataPoint- Gauge datapoint to be collected
 
 - 
collectpublic io.prometheus.metrics.model.snapshots.MetricSnapshots collect() Returns an immutableMetricSnapshotsfrom theDataPointSnapshots collected from the registry
 
- 
 
-