4 Commits

Author SHA1 Message Date
Max Inden
3f4dbb1717
{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
2022-02-03 11:31:41 +01:00
Max Inden
220f84a97f
swarm/: Enable advanced dialing requests (#2317)
Enable advanced dialing requests both on `Swarm` and via
`NetworkBehaviourAction`. Users can now trigger a dial with a specific
set of addresses, optionally extended via
`NetworkBehaviour::addresses_of_peer`. In addition the whole process is
now modelled in a type safe way via the builder pattern.

Example of a `NetworkBehaviour` requesting a dial to a specific peer
with a set of addresses additionally extended through
`NetworkBehaviour::addresses_of_peer`:

```rust
NetworkBehaviourAction::Dial {
    opts: DialOpts::peer_id(peer_id)
              .condition(PeerCondition::Always)
              .addresses(addresses)
              .extend_addresses_through_behaviour()
              .build(),
    handler,
}
```

Example of a user requesting a dial to an unknown peer with a single
address via `Swarm`:

```rust
swarm1.dial(
    DialOpts::unknown_peer_id()
        .address(addr2.clone())
        .build()
)
```
2021-11-15 14:17:23 +01:00
Max Inden
5ef430b8d8
misc/metrics/examples: Set openmetrics-text content-type (#2278)
Set "openmetrics-text" content type on HTTP GET response. Makes sure
Prometheus server parses returned metrics via OpenMetrics format instead
of legacy Prometheus format.
2021-10-07 14:07:25 +02:00
Max Inden
98bc5e6486
misc/metrics: Add auxiliary crate to record events as OpenMetrics (#2063)
This commit adds an auxiliary crate recording protocol and Swarm events
and exposing them as metrics in the OpenMetrics format.
2021-08-13 22:51:54 +02:00