Pulsar provides broker-level, namespace-level, and topic-level metrics to monitor and analyze the behavior of the Pulsar service. These metrics are accessible through the Prometheus metrics endpoint. Detailed explanations of all metrics can be found on the Pulsar website: Pulsar Metrics Reference
Within Pulsar's current metrics framework, the pulsar_out_bytes_total
metric is utilized to expose the total bytes dispatched by the broker to consumers. However, there are notable limitations and challenges associated with this metric:
This proposal aims to address the following objectives:
To achieve the outlined goals, the proposal introduces two new broker-level metrics:
pulsar_broker_out_bytes_total{system_subscription="true|false"}
: Represents the total out bytes dispatched by the broker to consumers. The label system_subscription="false"
represents total traffic dispatched to user subscriptions, while system_subscription="true"
represents total traffic dispatched to system cursors and cursor names added by additionalSystemCursorNames
introduced in PIP-349.pulsar_broker_in_bytes_total{system_topic="true|false"}
: Tracks the total in bytes sent by producers to the broker. The label system_topic="false"
represents total traffic from user topics, while system_topic="true"
represents total traffic from system topics.The implementation involves the introduction of the following broker-level metrics:
pulsar_broker_out_bytes_total{system_subscription="true|false"}
: Aggregates the total out bytes from all topics, presented as a broker-level metric.pulsar_broker_in_bytes_total{system_topic="true|false"}
: Calculation of total in bytes across all topics.The proposal includes the addition of two new broker-level metrics:
pulsar_broker_out_bytes_total{system_subscription="true|false"}
pulsar_broker_in_bytes_total{system_topic="true|false"}
The proposed changes ensure full compatibility with existing systems and pave the way for seamless integration with future enhancements.