Redis Streaming
首页
快速开始
  • 核心 API
  • Runtime
  • Config
  • State
  • Checkpoint
  • Watermark
  • Window
  • Source & Sink
  • Reliability
  • Registry
  • MQ
  • 架构设计
  • Exactly-Once
  • MQ 设计
  • Registry 设计
  • 部署指南
  • 性能调优
  • 故障排查
GitHub
首页
快速开始
  • 核心 API
  • Runtime
  • Config
  • State
  • Checkpoint
  • Watermark
  • Window
  • Source & Sink
  • Reliability
  • Registry
  • MQ
  • 架构设计
  • Exactly-Once
  • MQ 设计
  • Registry 设计
  • 部署指南
  • 性能调优
  • 故障排查
GitHub
  • 快速开始

    • 5分钟上手
    • Spring Boot 集成
  • 核心概念

    • 架构概述
    • 核心 API
    • 运行时环境
  • 基础设施模块

    • Config 配置中心
    • Registry 服务注册
    • MQ 消息队列
  • 流处理核心

    • State 状态管理
    • Checkpoint 检查点
    • Watermark 水位线
    • Window 窗口
  • 数据集成

    • Source & Sink
    • CDC 变更捕获
    • Aggregation 聚合
    • Table 表操作
    • Join 流连接
  • 可靠性

    • Reliability 组件
    • Metrics 监控
  • 设计文档

    • Exactly-Once 语义
    • MQ 设计
    • Registry 设计
  • 运维

    • 部署指南
    • 性能调优
    • 故障排查
    • CI/CD
  • 开发

    • 开发指南
    • 测试指南
    • 发布流程

Metrics

Module: metrics/

Micrometer/Prometheus metrics integration.

Scope

  • 指标采集抽象(MetricCollector)
  • Prometheus exporter(HTTP endpoint)与 Prometheus collector 实现

Key Classes

  • MetricCollector
  • prometheus.PrometheusMetricCollector
  • prometheus.PrometheusExporter
  • starter.metrics.MqMicrometerCollector(MQ 内部指标,Micrometer)

Minimal Sample (Prometheus)

import io.github.cuihairu.redis.streaming.metrics.prometheus.PrometheusExporter;
import io.github.cuihairu.redis.streaming.metrics.prometheus.PrometheusMetricCollector;

PrometheusMetricCollector collector = new PrometheusMetricCollector("streaming");
try (PrometheusExporter exporter = new PrometheusExporter(9090)) {
    collector.incrementCounter("mq_messages_total");
    collector.setGauge("active_consumers", 3);
    // scrape: http://localhost:9090/metrics
}

MQ Metrics (Micrometer)

When using spring-boot-starter, you can install a Micrometer collector for MQ via MqMetrics.setCollector(...).

Common metric names:

  • redis_streaming_mq_inflight (gauge, tag: consumer)
  • redis_streaming_mq_max_inflight (gauge, tag: consumer)
  • redis_streaming_mq_max_leased_partitions (gauge, tag: consumer)
  • redis_streaming_mq_backpressure_wait_total (counter, tag: consumer)
  • redis_streaming_mq_backpressure_wait_ms (timer, tag: consumer)
  • redis_streaming_mq_eligible_partitions (gauge, tags: consumer, topic, group)
  • redis_streaming_mq_leased_partitions (gauge, tags: consumer, topic, group)

Runtime Metrics (Micrometer)

When using spring-boot-starter, Redis runtime metrics are auto-installed via RedisRuntimeMetrics.setCollector(...).

Common metric names:

  • redis_streaming_runtime_job_started_total (counter, tag: job)
  • redis_streaming_runtime_pipeline_started_total (counter, tags: job, topic, group)
  • redis_streaming_runtime_handle_success_total / redis_streaming_runtime_handle_error_total (counter, tags: job, topic, group)
  • redis_streaming_runtime_handle_latency_ms (timer, tags: job, topic, group)
  • redis_streaming_runtime_checkpoint_triggered_total / completed_total / failed_total (counter, tag: job)
  • redis_streaming_runtime_checkpoint_duration_ms / drain_duration_ms / store_duration_ms / sink_commit_duration_ms (timer, tag: job)
  • redis_streaming_runtime_keyed_state_* (read/write/delete counters + read/write latency timers; tags: job, topic, group, operator, state, partition)
  • redis_streaming_runtime_event_time_timer_queue_size (gauge, tags: job, topic, group)
  • redis_streaming_runtime_watermark_ms (gauge, tags: job, topic, group)
  • redis_streaming_runtime_window_fired_total / window_late_dropped_total (counter, tags: job, topic, group, operator, state, partition)

References

  • Spring-Boot-Starter.md
  • Spring-Boot-Starter-en.md
Edit this page
最近更新: 2026/1/1 13:26
Contributors: cuihairu
Prev
Reliability 组件