{misc,protocols/gossipsub}: Move to prometheus-client (#2442)

`open-metrics-client` has been accepted as the official Prometheus Rust
client and thus renamed to `prometheus-client`.

See https://groups.google.com/g/prometheus-developers/c/E67ByGmVQKM
This commit is contained in:
Max Inden 2022-02-03 11:31:41 +01:00 committed by GitHub
parent fbdd208da6
commit 3f4dbb1717
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 62 additions and 44 deletions

View File

@ -42,6 +42,12 @@
# `libp2p` facade crate # `libp2p` facade crate
## Version 0.43.0 [unreleased]
- Update individual crates.
- `libp2p-gossipsub`
- `libp2p-metrics`
## Version 0.42.1 [2022-02-02] ## Version 0.42.1 [2022-02-02]
- Update individual crates. - Update individual crates.

View File

@ -3,7 +3,7 @@ name = "libp2p"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.56.1"
description = "Peer-to-peer networking library" description = "Peer-to-peer networking library"
version = "0.42.1" version = "0.43.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT" license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p" repository = "https://github.com/libp2p/rust-libp2p"
@ -79,10 +79,10 @@ lazy_static = "1.2"
libp2p-autonat = { version = "0.1.0", path = "protocols/autonat", optional = true } libp2p-autonat = { version = "0.1.0", path = "protocols/autonat", optional = true }
libp2p-core = { version = "0.31.0", path = "core", default-features = false } libp2p-core = { version = "0.31.0", path = "core", default-features = false }
libp2p-floodsub = { version = "0.33.0", path = "protocols/floodsub", optional = true } libp2p-floodsub = { version = "0.33.0", path = "protocols/floodsub", optional = true }
libp2p-gossipsub = { version = "0.35.0", path = "./protocols/gossipsub", optional = true } libp2p-gossipsub = { version = "0.36.0", path = "./protocols/gossipsub", optional = true }
libp2p-identify = { version = "0.33.0", path = "protocols/identify", optional = true } libp2p-identify = { version = "0.33.0", path = "protocols/identify", optional = true }
libp2p-kad = { version = "0.34.0", path = "protocols/kad", optional = true } libp2p-kad = { version = "0.34.0", path = "protocols/kad", optional = true }
libp2p-metrics = { version = "0.3.0", path = "misc/metrics", optional = true } libp2p-metrics = { version = "0.4.0", path = "misc/metrics", optional = true }
libp2p-mplex = { version = "0.31.0", path = "muxers/mplex", optional = true } libp2p-mplex = { version = "0.31.0", path = "muxers/mplex", optional = true }
libp2p-noise = { version = "0.34.0", path = "transports/noise", optional = true } libp2p-noise = { version = "0.34.0", path = "transports/noise", optional = true }
libp2p-ping = { version = "0.33.0", path = "protocols/ping", optional = true } libp2p-ping = { version = "0.33.0", path = "protocols/ping", optional = true }

View File

@ -1,3 +1,9 @@
# 0.4.0 [unreleased]
- Move from `open-metrics-client` to `prometheus-client` (see [PR 2442]).
[PR 2442]: https://github.com/libp2p/rust-libp2p/pull/2442
# 0.3.0 [2022-01-27] # 0.3.0 [2022-01-27]
- Update dependencies. - Update dependencies.

View File

@ -3,7 +3,7 @@ name = "libp2p-metrics"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.56.1"
description = "Metrics for libp2p" description = "Metrics for libp2p"
version = "0.3.0" version = "0.4.0"
authors = ["Max Inden <mail@max-inden.de>"] authors = ["Max Inden <mail@max-inden.de>"]
license = "MIT" license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p" repository = "https://github.com/libp2p/rust-libp2p"
@ -19,13 +19,13 @@ relay = ["libp2p-relay"]
[dependencies] [dependencies]
libp2p-core = { version = "0.31.0", path = "../../core", default-features = false } libp2p-core = { version = "0.31.0", path = "../../core", default-features = false }
libp2p-gossipsub = { version = "0.35.0", path = "../../protocols/gossipsub", optional = true } libp2p-gossipsub = { version = "0.36.0", path = "../../protocols/gossipsub", optional = true }
libp2p-identify = { version = "0.33.0", path = "../../protocols/identify", optional = true } libp2p-identify = { version = "0.33.0", path = "../../protocols/identify", optional = true }
libp2p-kad = { version = "0.34.0", path = "../../protocols/kad", optional = true } libp2p-kad = { version = "0.34.0", path = "../../protocols/kad", optional = true }
libp2p-ping = { version = "0.33.0", path = "../../protocols/ping", optional = true } libp2p-ping = { version = "0.33.0", path = "../../protocols/ping", optional = true }
libp2p-relay = { version = "0.6.0", path = "../../protocols/relay", optional = true } libp2p-relay = { version = "0.6.0", path = "../../protocols/relay", optional = true }
libp2p-swarm = { version = "0.33.0", path = "../../swarm" } libp2p-swarm = { version = "0.33.0", path = "../../swarm" }
open-metrics-client = "0.14.0" prometheus-client = "0.15.0"
[dev-dependencies] [dev-dependencies]
env_logger = "0.8.1" env_logger = "0.8.1"

View File

@ -55,8 +55,8 @@ use libp2p::metrics::{Metrics, Recorder};
use libp2p::ping::{Ping, PingConfig}; use libp2p::ping::{Ping, PingConfig};
use libp2p::swarm::SwarmEvent; use libp2p::swarm::SwarmEvent;
use libp2p::{identity, PeerId, Swarm}; use libp2p::{identity, PeerId, Swarm};
use open_metrics_client::encoding::text::encode; use prometheus_client::encoding::text::encode;
use open_metrics_client::registry::Registry; use prometheus_client::registry::Registry;
use std::error::Error; use std::error::Error;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::thread; use std::thread;

View File

@ -18,8 +18,8 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
use open_metrics_client::metrics::counter::Counter; use prometheus_client::metrics::counter::Counter;
use open_metrics_client::registry::Registry; use prometheus_client::registry::Registry;
pub struct Metrics { pub struct Metrics {
messages: Counter, messages: Counter,

View File

@ -18,9 +18,9 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
use open_metrics_client::metrics::counter::Counter; use prometheus_client::metrics::counter::Counter;
use open_metrics_client::metrics::histogram::{exponential_buckets, Histogram}; use prometheus_client::metrics::histogram::{exponential_buckets, Histogram};
use open_metrics_client::registry::Registry; use prometheus_client::registry::Registry;
use std::iter; use std::iter;
pub struct Metrics { pub struct Metrics {

View File

@ -18,11 +18,11 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
use open_metrics_client::encoding::text::Encode; use prometheus_client::encoding::text::Encode;
use open_metrics_client::metrics::counter::Counter; use prometheus_client::metrics::counter::Counter;
use open_metrics_client::metrics::family::Family; use prometheus_client::metrics::family::Family;
use open_metrics_client::metrics::histogram::{exponential_buckets, Histogram}; use prometheus_client::metrics::histogram::{exponential_buckets, Histogram};
use open_metrics_client::registry::{Registry, Unit}; use prometheus_client::registry::{Registry, Unit};
pub struct Metrics { pub struct Metrics {
query_result_get_record_ok: Histogram, query_result_get_record_ok: Histogram,

View File

@ -37,7 +37,7 @@ mod ping;
mod relay; mod relay;
mod swarm; mod swarm;
use open_metrics_client::registry::Registry; use prometheus_client::registry::Registry;
/// Set of Swarm and protocol metrics derived from emitted events. /// Set of Swarm and protocol metrics derived from emitted events.
pub struct Metrics { pub struct Metrics {
@ -58,7 +58,7 @@ impl Metrics {
/// Create a new set of Swarm and protocol [`Metrics`]. /// Create a new set of Swarm and protocol [`Metrics`].
/// ///
/// ``` /// ```
/// use open_metrics_client::registry::Registry; /// use prometheus_client::registry::Registry;
/// use libp2p_metrics::Metrics; /// use libp2p_metrics::Metrics;
/// let mut registry = Registry::default(); /// let mut registry = Registry::default();
/// let metrics = Metrics::new(&mut registry); /// let metrics = Metrics::new(&mut registry);

View File

@ -18,11 +18,11 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
use open_metrics_client::encoding::text::Encode; use prometheus_client::encoding::text::Encode;
use open_metrics_client::metrics::counter::Counter; use prometheus_client::metrics::counter::Counter;
use open_metrics_client::metrics::family::Family; use prometheus_client::metrics::family::Family;
use open_metrics_client::metrics::histogram::{exponential_buckets, Histogram}; use prometheus_client::metrics::histogram::{exponential_buckets, Histogram};
use open_metrics_client::registry::{Registry, Unit}; use prometheus_client::registry::{Registry, Unit};
#[derive(Clone, Hash, PartialEq, Eq, Encode)] #[derive(Clone, Hash, PartialEq, Eq, Encode)]
struct FailureLabels { struct FailureLabels {

View File

@ -18,10 +18,10 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
use open_metrics_client::encoding::text::Encode; use prometheus_client::encoding::text::Encode;
use open_metrics_client::metrics::counter::Counter; use prometheus_client::metrics::counter::Counter;
use open_metrics_client::metrics::family::Family; use prometheus_client::metrics::family::Family;
use open_metrics_client::registry::Registry; use prometheus_client::registry::Registry;
pub struct Metrics { pub struct Metrics {
events: Family<EventLabels, Counter>, events: Family<EventLabels, Counter>,

View File

@ -18,10 +18,10 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
use open_metrics_client::encoding::text::Encode; use prometheus_client::encoding::text::Encode;
use open_metrics_client::metrics::counter::Counter; use prometheus_client::metrics::counter::Counter;
use open_metrics_client::metrics::family::Family; use prometheus_client::metrics::family::Family;
use open_metrics_client::registry::Registry; use prometheus_client::registry::Registry;
pub struct Metrics { pub struct Metrics {
connections_incoming: Counter, connections_incoming: Counter,

View File

@ -1,3 +1,9 @@
# 0.36.0 [unreleased]
- Move from `open-metrics-client` to `prometheus-client` (see [PR 2442]).
[PR 2442]: https://github.com/libp2p/rust-libp2p/pull/2442
# 0.35.0 [2022-01-27] # 0.35.0 [2022-01-27]
- Update dependencies. - Update dependencies.

View File

@ -3,7 +3,7 @@ name = "libp2p-gossipsub"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.56.1"
description = "Gossipsub protocol for libp2p" description = "Gossipsub protocol for libp2p"
version = "0.35.0" version = "0.36.0"
authors = ["Age Manning <Age@AgeManning.com>"] authors = ["Age Manning <Age@AgeManning.com>"]
license = "MIT" license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p" repository = "https://github.com/libp2p/rust-libp2p"
@ -32,7 +32,7 @@ pin-project = "1.0.8"
instant = "0.1.11" instant = "0.1.11"
serde = { version = "1", optional = true, features = ["derive"] } serde = { version = "1", optional = true, features = ["derive"] }
# Metrics dependencies # Metrics dependencies
open-metrics-client = "0.14.0" prometheus-client = "0.15.0"
[dev-dependencies] [dev-dependencies]
async-std = "1.6.3" async-std = "1.6.3"

View File

@ -32,7 +32,7 @@ use std::{
use futures::StreamExt; use futures::StreamExt;
use log::{debug, error, trace, warn}; use log::{debug, error, trace, warn};
use open_metrics_client::registry::Registry; use prometheus_client::registry::Registry;
use prost::Message; use prost::Message;
use rand::{seq::SliceRandom, thread_rng}; use rand::{seq::SliceRandom, thread_rng};

View File

@ -23,12 +23,12 @@
use std::collections::HashMap; use std::collections::HashMap;
use open_metrics_client::encoding::text::Encode; use prometheus_client::encoding::text::Encode;
use open_metrics_client::metrics::counter::Counter; use prometheus_client::metrics::counter::Counter;
use open_metrics_client::metrics::family::{Family, MetricConstructor}; use prometheus_client::metrics::family::{Family, MetricConstructor};
use open_metrics_client::metrics::gauge::Gauge; use prometheus_client::metrics::gauge::Gauge;
use open_metrics_client::metrics::histogram::{linear_buckets, Histogram}; use prometheus_client::metrics::histogram::{linear_buckets, Histogram};
use open_metrics_client::registry::Registry; use prometheus_client::registry::Registry;
use crate::topic::TopicHash; use crate::topic::TopicHash;
use crate::types::{MessageAcceptance, PeerKind}; use crate::types::{MessageAcceptance, PeerKind};

View File

@ -20,7 +20,7 @@
use crate::rpc_proto; use crate::rpc_proto;
use base64::encode; use base64::encode;
use open_metrics_client::encoding::text::Encode; use prometheus_client::encoding::text::Encode;
use prost::Message; use prost::Message;
use sha2::{Digest, Sha256}; use sha2::{Digest, Sha256};
use std::fmt; use std::fmt;

View File

@ -22,7 +22,7 @@
use crate::rpc_proto; use crate::rpc_proto;
use crate::TopicHash; use crate::TopicHash;
use libp2p_core::{connection::ConnectionId, PeerId}; use libp2p_core::{connection::ConnectionId, PeerId};
use open_metrics_client::encoding::text::Encode; use prometheus_client::encoding::text::Encode;
use prost::Message; use prost::Message;
use std::fmt; use std::fmt;
use std::fmt::Debug; use std::fmt::Debug;