Class PrometheusMetricsGenerator
java.lang.Object
org.apache.pulsar.broker.stats.prometheus.PrometheusMetricsGenerator
- All Implemented Interfaces:
AutoCloseable
Generate metrics aggregated at the namespace level and optionally at a topic level and formats them out
in a text format suitable to be consumed by Prometheus.
Format specification can be found at Exposition Formats
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classA wraps the response buffer and asynchronously provides a gzip compressed buffer when requested. -
Constructor Summary
ConstructorsConstructorDescriptionPrometheusMetricsGenerator(PulsarService pulsar, boolean includeTopicMetrics, boolean includeConsumerMetrics, boolean includeProducerMetrics, boolean splitTopicAndPartitionIndexLabel, Clock clock) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected io.netty.buffer.ByteBufgenerateMetrics(List<PrometheusRawMetricsProvider> metricsProviders) renderToBuffer(Executor executor, List<PrometheusRawMetricsProvider> metricsProviders)
-
Constructor Details
-
PrometheusMetricsGenerator
public PrometheusMetricsGenerator(PulsarService pulsar, boolean includeTopicMetrics, boolean includeConsumerMetrics, boolean includeProducerMetrics, boolean splitTopicAndPartitionIndexLabel, Clock clock)
-
-
Method Details
-
generateMetrics
protected io.netty.buffer.ByteBuf generateMetrics(List<PrometheusRawMetricsProvider> metricsProviders) -
renderToBuffer
public PrometheusMetricsGenerator.MetricsBuffer renderToBuffer(Executor executor, List<PrometheusRawMetricsProvider> metricsProviders) -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-