Prometheus summaries for ManagedLedger metrics are documented and exposed incorrectly
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
**Describe the bug**
Documented as histograms: https://pulsar.apache.org/docs/en/next/reference-metrics/#managedledger-metrics
Exposed as gauges:
```
# TYPE pulsar_ml_EntrySizeBuckets gauge
pulsar_ml_EntrySizeBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="0.0_128.0"} 0.0 1642717994925
pulsar_ml_EntrySizeBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="1024.0_2048.0"} 0.0 1642717994925
pulsar_ml_EntrySizeBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="102400.0_1232896.0"} 0.0 1642717994925
pulsar_ml_EntrySizeBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="128.0_512.0"} 0.0 1642717994925
pulsar_ml_EntrySizeBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="16384.0_102400.0"} 0.0 1642717994925
pulsar_ml_EntrySizeBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="2048.0_4096.0"} 0.0 1642717994925
pulsar_ml_EntrySizeBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="4096.0_16384.0"} 0.0 1642717994925
pulsar_ml_EntrySizeBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="512.0_1024.0"} 0.0 1642717994925
# TYPE pulsar_ml_EntrySizeBuckets_OVERFLOW gauge
pulsar_ml_EntrySizeBuckets_OVERFLOW{cluster="standalone", namespace="public/functions/persistent"} 0.0 1642717994925
# TYPE pulsar_ml_LedgerAddEntryLatencyBuckets gauge
pulsar_ml_LedgerAddEntryLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="0.0_0.5"} 0.0 1642717994925
pulsar_ml_LedgerAddEntryLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="0.5_1.0"} 0.0 1642717994925
pulsar_ml_LedgerAddEntryLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="1.0_5.0"} 0.0 1642717994925
pulsar_ml_LedgerAddEntryLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="10.0_20.0"} 0.0 1642717994925
pulsar_ml_LedgerAddEntryLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="100.0_200.0"} 0.0 1642717994925
pulsar_ml_LedgerAddEntryLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="20.0_50.0"} 0.0 1642717994925
pulsar_ml_LedgerAddEntryLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="200.0_1000.0"} 0.0 1642717994925
pulsar_ml_LedgerAddEntryLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="5.0_10.0"} 0.0 1642717994925
pulsar_ml_LedgerAddEntryLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="50.0_100.0"} 0.0 1642717994925
# TYPE pulsar_ml_LedgerAddEntryLatencyBuckets_OVERFLOW gauge
pulsar_ml_LedgerAddEntryLatencyBuckets_OVERFLOW{cluster="standalone", namespace="public/functions/persistent"} 0.0 1642717994925
# TYPE pulsar_ml_LedgerSwitchLatencyBuckets gauge
pulsar_ml_LedgerSwitchLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="0.0_0.5"} 0.0 1642717994925
pulsar_ml_LedgerSwitchLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="0.5_1.0"} 0.0 1642717994925
pulsar_ml_LedgerSwitchLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="1.0_5.0"} 0.0 1642717994925
pulsar_ml_LedgerSwitchLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="10.0_20.0"} 0.0 1642717994925
pulsar_ml_LedgerSwitchLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="100.0_200.0"} 0.0 1642717994925
pulsar_ml_LedgerSwitchLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="20.0_50.0"} 0.0 1642717994925
pulsar_ml_LedgerSwitchLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="200.0_1000.0"} 0.0 1642717994925
pulsar_ml_LedgerSwitchLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="5.0_10.0"} 0.0 1642717994925
pulsar_ml_LedgerSwitchLatencyBuckets{cluster="standalone", namespace="public/functions/persistent", quantile="50.0_100.0"} 0.0 1642717994925
# TYPE pulsar_ml_LedgerSwitchLatencyBuckets_OVERFLOW gauge
pulsar_ml_LedgerSwitchLatencyBuckets_OVERFLOW{cluster="standalone", namespace="public/functions/persistent"} 0.0 1642717994925
```
**To Reproduce**
Steps to reproduce the behavior:
```
curl -L http://localhost:8080/metrics
```
```yaml
version: '3'
services:
pulsar:
container_name: pulsar
image: apachepulsar/pulsar:2.9.1
command:
- bash
- -c
- >
bin/apply-config-from-env-with-prefix.py BOOKKEEPER_ conf/bookkeeper.conf &&
bin/apply-config-from-env-with-prefix.py BROKER_ conf/broker.conf &&
bin/apply-config-from-env-with-prefix.py STANDALONE_ conf/standalone.conf &&
exec bin/pulsar standalone
ports:
- '6650:6650'
- '8080:8080'
environment:
- BOOKKEEPER_enableStatistics=true
- BOOKKEEPER_prometheusStatsHttpPort=8080
- BROKER_exposeTopicLevelMetricsInPrometheus=true
- BROKER_exposeConsumerLevelMetricsInPrometheus=true
- BROKER_exposeProducerLevelMetricsInPrometheus=true
- BROKER_exposeManagedLedgerMetricsInPrometheus=true
- BROKER_exposeManagedCursorMetricsInPrometheus=true
- BROKER_exposePublisherStats=true
- BROKER_exposePreciseBacklogInPrometheus=true
- BROKER_splitTopicAndPartitionLabelInPrometheus=true
- STANDALONE_exposeTopicLevelMetricsInPrometheus=true
- STANDALONE_exposeConsumerLevelMetricsInPrometheus=true
- STANDALONE_exposeProducerLevelMetricsInPrometheus=true
- STANDALONE_exposeManagedLedgerMetricsInPrometheus=true
- STANDALONE_exposeManagedCursorMetricsInPrometheus=true
- STANDALONE_exposePublisherStats=true
- STANDALONE_exposePreciseBacklogInPrometheus=true
- STANDALONE_splitTopicAndPartitionLabelInPrometheus=true
```
**Desktop (please complete the following information):**
- OS: Windows 10
Contributor guide
Research direction
Start with the provided Pulsar 2.9.1 standalone Docker setup and query the /metrics endpoint to reproduce the managed-ledger output. Compare the exposed metric types and the managed-ledger metrics documentation; done means the documented and Prometheus-exposed summary metrics agree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, prometheus
- Domain
- documentation, observability-sre
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100