Class PrometheusMetricsProvider
java.lang.Object
org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
- All Implemented Interfaces:
StatsProvider
A Prometheus based
StatsProvider implementation.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ConcurrentMap<ScopeContext,LongAdderCounter> static final Stringstatic final booleanstatic final intstatic final int(package private) final ConcurrentMap<ScopeContext,SimpleGauge<? extends Number>> (package private) final ConcurrentMap<ScopeContext,DataSketchesOpStatsLogger> static final Stringstatic final Stringstatic final Stringstatic final String(package private) final io.prometheus.client.CollectorRegistry(package private) org.eclipse.jetty.server.Server(package private) final ConcurrentMap<ScopeContext,ThreadScopedLongAdderCounter> (package private) final ConcurrentMap<ScopeContext,ThreadScopedDataSketchesStatsLogger> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetStatsLogger(String scope) Return the stats logger to a given scope.getStatsName(String... statsComponents) Return the fully qualified stats name comprised of given statsComponents.(package private) voidvoidstart(org.apache.commons.configuration2.Configuration conf) Initialize the stats provider by loading the given configuration conf.voidstop()Close the stats provider.voidwriteAllMetrics(Writer writer)
-
Field Details
-
PROMETHEUS_STATS_HTTP_ENABLE
- See Also:
-
DEFAULT_PROMETHEUS_STATS_HTTP_ENABLE
public static final boolean DEFAULT_PROMETHEUS_STATS_HTTP_ENABLE- See Also:
-
PROMETHEUS_STATS_HTTP_ADDRESS
- See Also:
-
DEFAULT_PROMETHEUS_STATS_HTTP_ADDR
- See Also:
-
PROMETHEUS_STATS_HTTP_PORT
- See Also:
-
DEFAULT_PROMETHEUS_STATS_HTTP_PORT
public static final int DEFAULT_PROMETHEUS_STATS_HTTP_PORT- See Also:
-
PROMETHEUS_STATS_LATENCY_ROLLOVER_SECONDS
- See Also:
-
DEFAULT_PROMETHEUS_STATS_LATENCY_ROLLOVER_SECONDS
public static final int DEFAULT_PROMETHEUS_STATS_LATENCY_ROLLOVER_SECONDS- See Also:
-
registry
final io.prometheus.client.CollectorRegistry registry -
server
org.eclipse.jetty.server.Server server -
counters
-
gauges
-
opStats
-
threadScopedOpStats
-
threadScopedCounters
-
-
Constructor Details
-
PrometheusMetricsProvider
public PrometheusMetricsProvider() -
PrometheusMetricsProvider
public PrometheusMetricsProvider(io.prometheus.client.CollectorRegistry registry)
-
-
Method Details
-
start
public void start(org.apache.commons.configuration2.Configuration conf) Description copied from interface:StatsProviderInitialize the stats provider by loading the given configuration conf.- Specified by:
startin interfaceStatsProvider- Parameters:
conf- Configuration to configure the stats provider.
-
stop
public void stop()Description copied from interface:StatsProviderClose the stats provider.- Specified by:
stopin interfaceStatsProvider
-
getStatsLogger
Description copied from interface:StatsProviderReturn the stats logger to a given scope.- Specified by:
getStatsLoggerin interfaceStatsProvider- Parameters:
scope- Scope for the given stats- Returns:
- stats logger for the given scope
-
writeAllMetrics
- Specified by:
writeAllMetricsin interfaceStatsProvider- Throws:
IOException
-
getStatsName
Description copied from interface:StatsProviderReturn the fully qualified stats name comprised of given statsComponents.- Specified by:
getStatsNamein interfaceStatsProvider- Parameters:
statsComponents- stats components to comprise the fully qualified stats name- Returns:
- the fully qualified stats name
-
rotateLatencyCollection
void rotateLatencyCollection()
-