MetricsPlugin, MetricsSinkpublic class PrometheusMetricsSink extends java.lang.Object implements MetricsSink
Stores the metric data in-memory and return with it on request.
| Constructor | Description |
|---|---|
PrometheusMetricsSink() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
flush() |
Flush any buffered metrics
|
void |
init(org.apache.commons.configuration2.SubsetConfiguration conf) |
Initialize the plugin
|
java.lang.String |
prometheusName(java.lang.String recordName,
java.lang.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(java.io.Writer writer) |
public void putMetrics(MetricsRecord metricsRecord)
MetricsSinkputMetrics in interface MetricsSinkmetricsRecord - the record to putpublic java.lang.String prometheusName(java.lang.String recordName,
java.lang.String metricName)
metricName - metricName.recordName - recordName.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(java.io.Writer writer)
throws java.io.IOException
java.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.