iota_data_ingestion_core/
metrics.rs

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