qianye1001 opened a new pull request, #1339: URL: https://github.com/apache/rocketmq-clients/pull/1339
## What changed - Add an internal Kafka-style JMX reporter for the Java gRPC client's existing message metrics. - Keep JMX reporting disabled by default and enable it with `-Drocketmq.client.jmx.enabled=true` before constructing a client. - Register label-set MBeans under the `org.apache.rocketmq.client` domain without adding a public client API, network endpoint, or Prometheus dependency. - Keep the reporter independent from the server-controlled OTLP metrics setting and unregister client-owned MBeans on shutdown. - Refresh PushConsumer gauge registrations after assignment scans while reading gauge values dynamically. ## Metrics - `rocketmq_send_cost_time`: count, sum, and histogram buckets, labeled by topic, client ID, and invocation status. - `rocketmq_delivery_latency`: count, sum, and histogram buckets. - `rocketmq_await_time`: count, sum, and histogram buckets. - `rocketmq_process_time`: count, sum, and histogram buckets. - `rocketmq_consumer_cached_messages`: gauge. - `rocketmq_consumer_cached_bytes`: gauge. Applications that already run a Prometheus JMX Exporter can scrape these MBeans. With the property unset, the reporter does not initialize the platform MBean server or allocate metric containers. ## Validation - JDK 11: `mvn -pl client -am -Dmaven.gitcommitid.skip=true test` — 302 tests, 0 failures, 1 existing skip. - JDK 21: reporter and manager tests — 8 tests, 0 failures. - JDK 8 runtime: reporter and manager JUnit tests — 8 tests, 0 failures. - Checkstyle and SpotBugs passed. - Generated class major version remains 52. Fixes #1338 -- 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]
