Skip to content

Commit c53d47b

Browse files
authored
*: Prepare v0.19.0-alpha (#113)
Signed-off-by: Max Inden <[email protected]>
1 parent 83dd006 commit c53d47b

File tree

3 files changed

+59
-4
lines changed

3 files changed

+59
-4
lines changed

CHANGELOG.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,64 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [0.19.0] - unreleased
7+
## [0.19.0-alpha]
8+
9+
This is a large release including multiple breaking changes. Major user-facing
10+
improvement of this release is support for the OpenMetrics Protobuf format.
11+
12+
### Upgrade guide:
13+
14+
- Don't box before registering.
15+
16+
```diff
17+
registry.register(
18+
"my_metric",
19+
"This is my metric",
20+
- Box::new(my_metric.clone()),
21+
+ my_metric.clone(),
22+
);
23+
```
24+
25+
- Gauge uses `i64` instead of `u64`.
26+
27+
```diff
28+
my_gauge
29+
- .set(42u64);
30+
+ .set(42i64);
31+
```
32+
33+
- Derive `EncodeLabelSet` for `struct` and `EncodeLabelValue` for `enum` instead of just `Encode` for all and require `Debug`.
34+
35+
```diff
36+
- #[derive(Clone, Hash, PartialEq, Eq, Encode)]
37+
+ #[derive(Clone, Hash, PartialEq, Eq, EncodeLabelSet, Debug)]
38+
struct Labels {
39+
path: String,
40+
method: Method,
41+
some_number: u64,
42+
}
43+
44+
- #[derive(Clone, Hash, PartialEq, Eq, Encode)]
45+
+ #[derive(Clone, Hash, PartialEq, Eq, EncodeLabelValue, Debug)]
46+
enum Method {
47+
Get,
48+
#[allow(dead_code)]
49+
Put,
50+
}
51+
```
52+
53+
- Encode as utf-8 and not as `[u8]`.
54+
55+
```diff
56+
- let mut buffer = vec![];
57+
+ let mut buffer = String::new();
58+
encode(&mut buffer, &registry).unwrap();
59+
```
60+
61+
For details on each of these, see changelog entries below.
862

963
### Added
64+
1065
- Added support for the OpenMetrics protobuf format. See [PR 83].
1166
- Added a `remove` method to `Family` to allow the removal of a specified label
1267
set from a family. See [PR 85].

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "prometheus-client"
3-
version = "0.19.0"
3+
version = "0.19.0-alpha"
44
authors = ["Max Inden <[email protected]>"]
55
edition = "2021"
66
description = "Open Metrics client library allowing users to natively instrument applications."
@@ -21,7 +21,7 @@ members = ["derive-encode"]
2121
dtoa = "1.0"
2222
itoa = "1.0"
2323
parking_lot = "0.12"
24-
prometheus-client-derive-encode = { version = "0.3.0", path = "derive-encode" }
24+
prometheus-client-derive-encode = { version = "0.4.0", path = "derive-encode" }
2525
prost = { version = "0.11.0", optional = true }
2626
prost-types = { version = "0.11.0", optional = true }
2727

derive-encode/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "prometheus-client-derive-encode"
3-
version = "0.3.1"
3+
version = "0.4.0"
44
authors = ["Max Inden <[email protected]>"]
55
edition = "2021"
66
description = "Auxiliary crate to derive Encode trait from prometheus-client."

0 commit comments

Comments
 (0)