Skip to content

Commit

Permalink
Merge pull request #7850 from Xuanwo/fix-metrics
Browse files Browse the repository at this point in the history
fix: Metrics from opendal not collected
  • Loading branch information
Xuanwo authored Sep 23, 2022
2 parents 5e88aed + 5f6a116 commit b37a123
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 56 deletions.
69 changes: 20 additions & 49 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/common/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ test = false
common-exception = { path = "../exception" }

# Crates.io dependencies
metrics = "0.19.0"
metrics-exporter-prometheus = { version = "0.10.0", default-features = false }
metrics = "0.20.0"
metrics-exporter-prometheus = { version = "0.11.0", default-features = false }
once_cell = "1.15.0"
parking_lot = "0.12.1"
prometheus-parse = "0.2.3"
Expand Down
5 changes: 2 additions & 3 deletions src/common/storage/src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,8 @@ impl StorageOperator {
let io_runtime = GlobalIORuntime::instance();
let operator = init_operator(&conf.params)?
.layer(RetryLayer::new(ExponentialBackoff::default()))
.layer(LoggingLayer)
.layer(TracingLayer)
.layer(MetricsLayer);
.layer(MetricsLayer)
.layer(TracingLayer);

// OpenDAL will send a real request to underlying storage to check whether it works or not.
// If this check failed, it's highly possible that the users have configured it wrongly.
Expand Down
2 changes: 1 addition & 1 deletion src/query/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ http = "0.2.8"
itertools = "0.10.5"
jwtk = "0.2.4"
lz4 = "1.24.0"
metrics = "0.19.0"
metrics = "0.20.0"
naive-cityhash = "0.2.0"
nom = "7.1.1"
num = "0.4.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ async fn test_metrics_table() -> Result<()> {
let output = pretty_format_blocks(result.as_slice())?;
assert!(output.contains("test_test_metrics_table_count"));
assert!(output.contains("test_test_metrics_table_histogram"));
assert!(output.contains("[{\"quantile\":0.0,\"count\":1.0},{\"quantile\":0.5,\"count\":1.0},{\"quantile\":0.9,\"count\":1.0},{\"quantile\":0.95,\"count\":1.0},{\"quantile\":0.99,\"count\":1.0},{\"quantile\":0.999,\"count\":1.0},{\"quantile\":1.0,\"count\":1.0}]"));

Ok(())
}

1 comment on commit b37a123

@vercel
Copy link

@vercel vercel bot commented on b37a123 Sep 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

databend – ./

databend-databend.vercel.app
databend.vercel.app
databend-git-main-databend.vercel.app
databend.rs

Please sign in to comment.