Skip to content

Commit c66bf3c

Browse files
blpmihaibudiu
authored andcommitted
Rewrite metrics implementation.
Previously, Feldera used the `metrics` crate for metrics. This crate has lookup and locking overhead for individual metrics. It also ties metrics recording to metrics reporting: if there is a need to report metrics in more than one way, then one has to record the metrics in more than one place. We wanted to be able to report metrics in the Prometheus exposition format as well as in a bespoke JSON format, which meant that we had to set up two different recorders, each of which had nontrivial overhead. But the metrics we want are actually simple. The Prometheus exposition format is also simple, and so is the JSON format. This commit stops using the `metrics` crate, instead shifting to homegrown implementations of both formats in a new module `dbsp_adapters::server::metrics`. This commit deletes existing metrics that nothing actually incremented (or that was only incremented in debug code like the memory storage backend). They can't be that important if we weren't using them. Incidentally, at first I wanted to use the `serde_prometheus` crate for Prometheus exposition format, but it doesn't support basic features of the format, like types and descriptions. The format is simple, and it's easy enough to roll it ourselves, so I did that. Signed-off-by: Ben Pfaff <blp@feldera.com>
1 parent d70c655 commit c66bf3c

21 files changed

Lines changed: 1031 additions & 1020 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/adapters/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ apache-avro = { workspace = true, optional = true }
9494
schema_registry_converter = { workspace = true, features = ["avro", "blocking"], optional = true }
9595
rust_decimal = { package = "feldera_rust_decimal", version = "1.33.1-feldera.1", features = ["tokio-pg"] }
9696
url = { workspace = true }
97-
metrics = { workspace = true }
98-
metrics-util = { workspace = true }
99-
metrics-exporter-prometheus = { workspace = true }
10097
ordered-float = { workspace = true }
10198
openssl = { workspace = true }
10299
minitrace = { workspace = true, features = ["enable"] }
@@ -140,6 +137,7 @@ aws-credential-types = "1.2.3"
140137
feldera-sqllib = { workspace = true }
141138
inventory = { workspace = true }
142139
backtrace = { workspace = true }
140+
itertools = { workspace = true }
143141

144142
[package.metadata.cargo-machete]
145143
ignored = ["num-traits"]

0 commit comments

Comments
 (0)