Designs and implements minimal, high-value metrics for RobustMQ services and dashboards. Use when the user asks to add metrics, improve observability, or update Grafana panels for core processing pipelines.
Add observability with minimal but complete coverage of a target pipeline:
Do not over-instrument. Prefer compact metrics that support operations and debugging.
Cover chain, not everything:
Always include count and latency for processing path.
Label policy:
result, strategy, protocol)topic, error_message, payload-derived labelsNaming:
mqtt_, raft_, handler_)_total_ms_upAdapt this template to the target module:
<module>_messages_processed_success_total{...}<module>_messages_processed_failure_total{...}<module>_process_duration_ms{...} (histogram)<module>_retry_total{...,strategy} (if retry exists)<module>_terminal_total{...,result} (discard/dlq/drop etc., if applicable)<module>_critical_step_failure_total{...} (read/write/commit/etc.)<module>_up{...} (gauge)Define metrics in src/common/metrics
Insert runtime instrumentation
Fix call sites impacted by signature changes
Validation
cargo check for impacted cratesAfter metrics are added, decide whether to update grafana/robustmq-broker.json:
When updating dashboard:
Return: