Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
remove prometheus in Tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
nodebreaker0-0 committed Feb 5, 2020
1 parent 5e327c2 commit ccb3179
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
4 changes: 2 additions & 2 deletions client/cli/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,9 @@ pub struct RunCmd {
#[structopt(long = "prometheus-port", value_name = "PORT")]
pub prometheus_port: Option<u16>,

/// Disable connecting to the Substrate prometheus.
/// Do not expose a Prometheus metric endpoint.
///
/// prometheus is on by default on global chains.
/// Prometheus metric endpoint is enabled by default.
#[structopt(long = "no-prometheus")]
pub no_prometheus: bool,

Expand Down
8 changes: 1 addition & 7 deletions client/tracing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//! let span = tracing::span!(tracing::Level::INFO, "my_span_name", my_number = 10, a_key = "a value");
//! let _guard = span.enter();
//! ```
//! Currently we provide `Log` (default), `Telemetry` and `Prometheus` variants for `Receiver`
//! Currently we provide `Log` (default), `Telemetry` variants for `Receiver`
use std::collections::HashMap;
use std::fmt;
Expand Down Expand Up @@ -62,8 +62,6 @@ pub enum TracingReceiver {
Log,
/// Output to telemetry
Telemetry,
/// Output to Prometheus endpoint
Prometheus,
}

impl Default for TracingReceiver {
Expand Down Expand Up @@ -254,7 +252,6 @@ impl ProfilingSubscriber {
match self.receiver {
TracingReceiver::Log => print_log(span_datum),
TracingReceiver::Telemetry => send_telemetry(span_datum),
TracingReceiver::Prometheus => send_prometheus(span_datum),
}
}
}
Expand Down Expand Up @@ -290,6 +287,3 @@ fn send_telemetry(span_datum: SpanDatum) {
);
}

fn send_prometheus(_span_datum: SpanDatum) {
unimplemented!()
}
6 changes: 2 additions & 4 deletions utils/prometheus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,12 @@ async fn request_metrics(req: Request<Body>, registry: Registry) -> Result<Respo
let encoder = TextEncoder::new();
encoder.encode(&metric_families, &mut buffer).unwrap();

Response::builder()
.status(StatusCode::OK)
Response::builder().status(StatusCode::OK)
.header("Content-Type", encoder.format_type())
.body(Body::from(buffer))
.map_err(Error::Http)
} else {
Response::builder()
.status(StatusCode::NOT_FOUND)
Response::builder().status(StatusCode::NOT_FOUND)
.body(Body::from("Not found."))
.map_err(Error::Http)
}
Expand Down

0 comments on commit ccb3179

Please sign in to comment.