public class ReplaceableCollectorRegistry
extends io.prometheus.client.CollectorRegistry
CollectorRegistry that delegates all read operations to a registry reference.
This allows atomic collector registry replacements at runtime.
The standard CollectorRegistry only supports a register/unregister workflow which opens up a potential
race condition. And since the HTTPServer doesn't allow the replacement
of the collector registry without restarting the HTTP server, we need this custom implementation.
Write operations are not supported and will throw an UnsupportedOperationException.| Constructor and Description |
|---|
ReplaceableCollectorRegistry(AtomicReference<io.prometheus.client.CollectorRegistry> registryRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
Enumeration<io.prometheus.client.Collector.MetricFamilySamples> |
filteredMetricFamilySamples(Set<String> includedNames) |
Double |
getSampleValue(String name) |
Double |
getSampleValue(String name,
String[] labelNames,
String[] labelValues) |
Enumeration<io.prometheus.client.Collector.MetricFamilySamples> |
metricFamilySamples() |
void |
register(io.prometheus.client.Collector m) |
void |
unregister(io.prometheus.client.Collector m) |
public ReplaceableCollectorRegistry(AtomicReference<io.prometheus.client.CollectorRegistry> registryRef)
public void register(io.prometheus.client.Collector m)
register in class io.prometheus.client.CollectorRegistrypublic void unregister(io.prometheus.client.Collector m)
unregister in class io.prometheus.client.CollectorRegistrypublic void clear()
clear in class io.prometheus.client.CollectorRegistrypublic Enumeration<io.prometheus.client.Collector.MetricFamilySamples> metricFamilySamples()
metricFamilySamples in class io.prometheus.client.CollectorRegistrypublic Enumeration<io.prometheus.client.Collector.MetricFamilySamples> filteredMetricFamilySamples(Set<String> includedNames)
filteredMetricFamilySamples in class io.prometheus.client.CollectorRegistrypublic Double getSampleValue(String name)
getSampleValue in class io.prometheus.client.CollectorRegistryCopyright © 2012–2021 Graylog, Inc.. All rights reserved.