From 891a16f5eea6bb299ebec92597952b53cabad26a Mon Sep 17 00:00:00 2001 From: Max Inden Date: Sat, 10 Dec 2022 13:09:00 +0100 Subject: [PATCH] *: Prepare v0.19.0-alpha Signed-off-by: Max Inden --- CHANGELOG.md | 57 +++++++++++++++++++++++++++++++++++++++- Cargo.toml | 4 +-- derive-encode/Cargo.toml | 2 +- 3 files changed, 59 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 236f15d..d06867a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,64 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.19.0] - unreleased +## [0.19.0-alpha] + +This is a large release including multiple breaking changes. Major user-facing +improvement of this release is support for the OpenMetrics Protobuf format. + +### Upgrade guide: + +- Don't box before registering. + + ```diff + registry.register( + "my_metric", + "This is my metric", + - Box::new(my_metric.clone()), + + my_metric.clone(), + ); + ``` + +- Gauge uses `i64` instead of `u64`. + + ```diff + my_gauge + - .set(42u64); + + .set(42i64); + ``` + +- Derive `EncodeLabelSet` for `struct` and `EncodeLabelValue` for `enum` instead of just `Encode` for all and require `Debug`. + + ```diff + - #[derive(Clone, Hash, PartialEq, Eq, Encode)] + + #[derive(Clone, Hash, PartialEq, Eq, EncodeLabelSet, Debug)] + struct Labels { + path: String, + method: Method, + some_number: u64, + } + + - #[derive(Clone, Hash, PartialEq, Eq, Encode)] + + #[derive(Clone, Hash, PartialEq, Eq, EncodeLabelValue, Debug)] + enum Method { + Get, + #[allow(dead_code)] + Put, + } + ``` + +- Encode as utf-8 and not as `[u8]`. + + ```diff + - let mut buffer = vec![]; + + let mut buffer = String::new(); + encode(&mut buffer, ®istry).unwrap(); + ``` + +For details on each of these, see changelog entries below. ### Added + - Added support for the OpenMetrics protobuf format. See [PR 83]. - Added a `remove` method to `Family` to allow the removal of a specified label set from a family. See [PR 85]. diff --git a/Cargo.toml b/Cargo.toml index fcad770..5295f7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "prometheus-client" -version = "0.19.0" +version = "0.19.0-alpha" authors = ["Max Inden "] edition = "2021" description = "Open Metrics client library allowing users to natively instrument applications." @@ -21,7 +21,7 @@ members = ["derive-encode"] dtoa = "1.0" itoa = "1.0" parking_lot = "0.12" -prometheus-client-derive-encode = { version = "0.3.0", path = "derive-encode" } +prometheus-client-derive-encode = { version = "0.4.0", path = "derive-encode" } prost = { version = "0.11.0", optional = true } prost-types = { version = "0.11.0", optional = true } diff --git a/derive-encode/Cargo.toml b/derive-encode/Cargo.toml index 55b5f37..6155991 100644 --- a/derive-encode/Cargo.toml +++ b/derive-encode/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "prometheus-client-derive-encode" -version = "0.3.1" +version = "0.4.0" authors = ["Max Inden "] edition = "2021" description = "Auxiliary crate to derive Encode trait from prometheus-client."