public class PrometheusMetricsSink extends Object implements MetricsSink
Stores the metric data in-memory and return with it on request.
| Constructor and Description |
|---|
PrometheusMetricsSink() |
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Flush any buffered metrics
|
void |
init(org.apache.commons.configuration2.SubsetConfiguration conf)
Initialize the plugin
|
String |
prometheusName(String recordName,
String metricName)
Convert CamelCase based names to lower-case names where the separator
is the underscore, to follow prometheus naming conventions.
|
void |
putMetrics(MetricsRecord metricsRecord)
Put a metrics record in the sink
|
void |
writeMetrics(Writer writer) |
public void putMetrics(MetricsRecord metricsRecord)
MetricsSinkputMetrics in interface MetricsSinkmetricsRecord - the record to putpublic String prometheusName(String recordName, String metricName)
public void flush()
MetricsSinkflush in interface MetricsSinkpublic void init(org.apache.commons.configuration2.SubsetConfiguration conf)
MetricsPlugininit in interface MetricsPluginconf - the configuration object for the pluginpublic void writeMetrics(Writer writer) throws IOException
IOExceptionCopyright © 2008–2022 Apache Software Foundation. All rights reserved.