*: Rename prometheus-exporter crate to substrate-prometheus-end… (#5076)

This patch renames the crate for the following two reasons:

1. The prometheus-exporter crate introduces native in-process Prometheus
style instrumentation to the Substrate project. Within the Prometheus
ecosystem the term "exporter" is used for external processes exposing
metrics for e.g. the Linux Kernel. In-process exposition would be
described via the term "endpoint".

2. "prometheus-exporter" is generic and ignores the fact that it is only
usable within the context of Substrate. In addition the name
"prometheus-exporter" is already taken on crates.io.
This commit is contained in:
Max Inden
2020-02-27 17:48:26 +01:00
committed by GitHub
parent 9b67ac43ef
commit 9d49d917f6
8 changed files with 26 additions and 26 deletions
+3 -3
View File
@@ -53,7 +53,7 @@ use sysinfo::{get_current_pid, ProcessExt, System, SystemExt};
use sc_telemetry::{telemetry, SUBSTRATE_INFO};
use sp_transaction_pool::{MaintainedTransactionPool, ChainEvent};
use sp_blockchain;
use prometheus_exporter::{register, Gauge, U64, F64, Registry, PrometheusError, Opts, GaugeVec};
use substrate_prometheus_endpoint::{register, Gauge, U64, F64, Registry, PrometheusError, Opts, GaugeVec};
struct ServiceMetrics {
block_height_number: GaugeVec<U64>,
@@ -1020,7 +1020,7 @@ ServiceBuilder<
));
}
// Prometheus exporter and metrics
// Prometheus endpoint and metrics
let metrics = if let Some(port) = config.prometheus_port {
let registry = match prometheus_registry {
Some(registry) => registry,
@@ -1030,7 +1030,7 @@ ServiceBuilder<
let metrics = ServiceMetrics::register(&registry)?;
let future = select(
prometheus_exporter::init_prometheus(port, registry).boxed(),
substrate_prometheus_endpoint::init_prometheus(port, registry).boxed(),
exit.clone()
).map(drop);