mz_storage/metrics/sink.rs
1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10//! Metrics for sinks.
11
12use mz_ore::metrics::MetricsRegistry;
13
14pub mod iceberg;
15pub mod kafka;
16
17/// A set of base metrics that hang off a central metrics registry, labeled by the sink they
18/// belong to.
19#[derive(Debug, Clone)]
20pub(crate) struct SinkMetricDefs {
21 pub(crate) kafka_defs: kafka::KafkaSinkMetricDefs,
22 pub(crate) iceberg_defs: iceberg::IcebergSinkMetricDefs,
23}
24
25impl SinkMetricDefs {
26 pub(crate) fn register_with(registry: &MetricsRegistry) -> Self {
27 Self {
28 kafka_defs: kafka::KafkaSinkMetricDefs::register_with(registry),
29 iceberg_defs: iceberg::IcebergSinkMetricDefs::register_with(registry),
30 }
31 }
32}