From de3173af0314aa93b3793f1d56a5806738ec261b Mon Sep 17 00:00:00 2001 From: Boyu Yang Date: Tue, 8 Sep 2020 08:59:43 +0800 Subject: [PATCH] chore: remove direct dependencies of metrics exporters and observers --- Cargo.lock | 5 ----- util/metrics-service/Cargo.toml | 5 ----- util/metrics-service/src/lib.rs | 11 +++++------ 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a85ee9031b..e233ea5bb2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -713,11 +713,6 @@ dependencies = [ "ckb-util", "log 0.4.11", "metrics-core", - "metrics-exporter-http", - "metrics-exporter-log", - "metrics-observer-json", - "metrics-observer-prometheus", - "metrics-observer-yaml", "metrics-runtime", "tokio 0.2.22", ] diff --git a/util/metrics-service/Cargo.toml b/util/metrics-service/Cargo.toml index fbb8f1cc38..dc5d66b65e 100644 --- a/util/metrics-service/Cargo.toml +++ b/util/metrics-service/Cargo.toml @@ -12,10 +12,5 @@ ckb-stop-handler = { path = "../stop-handler" } ckb-util = { path = ".." } metrics-runtime = "~0.13.1" metrics-core = "~0.5.2" -metrics-exporter-log = "~0.4.0" -metrics-exporter-http = "~0.3.0" -metrics-observer-json = "~0.1.1" -metrics-observer-yaml = "~0.1.1" -metrics-observer-prometheus = "~0.1.4" log = "0.4" tokio = { version = "0.2", features = ["sync", "blocking", "rt-threaded", "time", "io-driver"] } diff --git a/util/metrics-service/src/lib.rs b/util/metrics-service/src/lib.rs index 25794bc72c..274d84e92c 100644 --- a/util/metrics-service/src/lib.rs +++ b/util/metrics-service/src/lib.rs @@ -1,12 +1,11 @@ use std::{net::SocketAddr, time::Duration}; use metrics_core::Observe; -use metrics_exporter_http::HttpExporter; -use metrics_exporter_log::LogExporter; -use metrics_observer_json::JsonBuilder; -use metrics_observer_prometheus::PrometheusBuilder; -use metrics_observer_yaml::YamlBuilder; -use metrics_runtime::Receiver; +use metrics_runtime::{ + exporters::{HttpExporter, LogExporter}, + observers::{JsonBuilder, PrometheusBuilder, YamlBuilder}, + Receiver, +}; use tokio::sync::oneshot; use ckb_async_runtime::{new_runtime, Builder, Handle};