KubeBlocks
BlogsEnterprise
⌘K
​
Blogs

Overview
Quickstart
Architecture

Operations

Stop / Start / Restart
Vertical Scaling
Horizontal Scaling
Volume Expansion
Reconfigure
Manage Services

Observability

Prometheus Integration
  1. Prerequisites
  2. Create a PodMonitor
  3. Verify Metrics Are Scraped
  4. Key Metrics
    1. Broker Metrics (rocketmq-exporter)
    2. JVM Metrics (jmx-exporter)
  5. Cleanup

Integrate RocketMQ with Prometheus Operator

RocketMQ clusters managed by KubeBlocks expose two metric sources:

SidecarPortMetrics
jmx-exportermetrics (5556)JVM metrics (GC, heap, threads)
rocketmq-exportermetrics (5557)Broker metrics (topics, queues, consumer lag)

Both are exposed on pods via the metrics named port.

Prerequisites

    Before proceeding, verify your environment meets these requirements:

    • A functional Kubernetes cluster (v1.21+ recommended)
    • kubectl v1.21+ installed and configured with cluster access
    • Helm installed (installation guide)
    • KubeBlocks installed (installation guide)
    • RocketMQ Add-on installed and a RocketMQ cluster running (see Quickstart)
    • Prometheus Operator installed in your cluster
    • Prometheus configured with podMonitorSelector matching label release: prometheus

    Create a PodMonitor

    kubectl apply -f - <<EOF apiVersion: monitoring.coreos.com/v1 kind: PodMonitor metadata: name: rocketmq-cluster-pod-monitor namespace: demo labels: release: prometheus spec: jobLabel: app.kubernetes.io/managed-by podTargetLabels: - app.kubernetes.io/instance - app.kubernetes.io/managed-by - apps.kubeblocks.io/component-name - apps.kubeblocks.io/pod-name podMetricsEndpoints: - path: /metrics port: metrics scheme: http namespaceSelector: matchNames: - demo selector: matchLabels: app.kubernetes.io/instance: rocketmq-cluster EOF
    NOTE

    If your Prometheus uses a different podMonitorSelector label, update the labels field accordingly.

    Verify the PodMonitor is created:

    kubectl get podmonitor rocketmq-cluster-pod-monitor -n demo
    Example Output
    NAME AGE rocketmq-cluster-pod-monitor 10s

    Verify Metrics Are Scraped

    Check which pods are being scraped:

    kubectl get pods -n demo -l app.kubernetes.io/instance=rocketmq-cluster \ -o custom-columns='NAME:.metadata.name,READY:.status.containerStatuses[*].name'

    Within a few minutes, Prometheus will discover the pods and begin scraping. Confirm in the Prometheus UI under Status → Targets.

    Key Metrics

    Broker Metrics (rocketmq-exporter)

    MetricDescription
    rocketmq_broker_tpsMessages produced per second
    rocketmq_broker_qpsMessages consumed per second
    rocketmq_consumer_tpsConsumer group throughput
    rocketmq_group_get_latency_by_storetimeConsumer lag by store time
    rocketmq_topic_retry_numsRetry queue depth per topic

    JVM Metrics (jmx-exporter)

    MetricDescription
    jvm_memory_bytes_usedJVM heap / non-heap usage
    jvm_gc_collection_secondsGC pause duration
    jvm_threads_currentActive thread count

    Cleanup

    kubectl delete podmonitor rocketmq-cluster-pod-monitor -n demo --ignore-not-found

    © 2026 KUBEBLOCKS INC