sui_data_ingestion_core/
metrics.rs

1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4use prometheus::{IntGaugeVec, Registry, register_int_gauge_vec_with_registry};
5
6#[derive(Clone)]
7pub struct DataIngestionMetrics {
8    pub data_ingestion_checkpoint: IntGaugeVec,
9}
10
11impl DataIngestionMetrics {
12    pub fn new(registry: &Registry) -> Self {
13        Self {
14            data_ingestion_checkpoint: register_int_gauge_vec_with_registry!(
15                "data_ingestion_checkpoint",
16                "Number of uploaded checkpoints.",
17                &["task"],
18                registry,
19            )
20            .unwrap(),
21        }
22    }
23}