chore(metrics): Upgrade to prometheus-client v0.19.0 (#3207)

This commit is contained in:
Max Inden
2023-01-03 20:42:32 +01:00
committed by GitHub
parent 9c96bbb54b
commit 2621528639
15 changed files with 127 additions and 123 deletions

View File

@ -18,7 +18,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
use prometheus_client::encoding::text::Encode;
use prometheus_client::encoding::{EncodeLabelSet, EncodeLabelValue};
use prometheus_client::metrics::counter::Counter;
use prometheus_client::metrics::family::Family;
use prometheus_client::registry::Registry;
@ -35,19 +35,19 @@ impl Metrics {
sub_registry.register(
"events",
"Events emitted by the relay NetworkBehaviour",
Box::new(events.clone()),
events.clone(),
);
Self { events }
}
}
#[derive(Debug, Clone, Hash, PartialEq, Eq, Encode)]
#[derive(Debug, Clone, Hash, PartialEq, Eq, EncodeLabelSet)]
struct EventLabels {
event: EventType,
}
#[derive(Debug, Clone, Hash, PartialEq, Eq, Encode)]
#[derive(Debug, Clone, Hash, PartialEq, Eq, EncodeLabelValue)]
enum EventType {
InitiateDirectConnectionUpgrade,
RemoteInitiatedDirectConnectionUpgrade,