qianye1001 opened a new issue, #1338: URL: https://github.com/apache/rocketmq-clients/issues/1338
### Background The Java gRPC client currently exports its built-in message metrics only through the server-provided OTLP endpoint. Applications that operate their own Prometheus stack need a way to collect the same client-side metrics without adding a client-owned HTTP endpoint or a Prometheus dependency. ### Proposal Add an internal reporter following Kafka's `JmxReporter` model: - Keep the reporter disabled by default. - Enable it with the JVM system property `-Drocketmq.client.jmx.enabled=true`. - Register metrics in the platform MBean server under the `org.apache.rocketmq.client` domain. - Let an application-provided Prometheus JMX Exporter scrape the MBeans when present. - Do not add a public client API, a network port, or a Prometheus library dependency. - Keep JMX collection independent from the server-controlled OTLP metrics setting. - Unregister client-owned MBeans during client shutdown. ### Metrics Expose the existing client metrics and labels: - `rocketmq_send_cost_time`: histogram with `topic`, `client_id`, and `invocation_status`. - `rocketmq_delivery_latency`: histogram with `topic`, `client_id`, and `consumer_group`. - `rocketmq_await_time`: histogram with `topic`, `client_id`, and `consumer_group`. - `rocketmq_process_time`: histogram with `topic`, `client_id`, `consumer_group`, and `invocation_status`. - `rocketmq_consumer_cached_messages`: gauge. - `rocketmq_consumer_cached_bytes`: gauge. Histogram MBeans should expose count, sum, finite buckets, and the positive-infinity bucket so that an external collector can map them to Prometheus metrics. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
