Skip to content

Commit

Permalink
*: Prepare v0.19.0-alpha (#113)
Browse files Browse the repository at this point in the history
Signed-off-by: Max Inden <mail@max-inden.de>
  • Loading branch information
mxinden committed Dec 10, 2022
1 parent 83dd006 commit c53d47b
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 4 deletions.
57 changes: 56 additions & 1 deletion CHANGELOG.md
Expand Up @@ -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, &registry).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].
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "prometheus-client"
version = "0.19.0"
version = "0.19.0-alpha"
authors = ["Max Inden <mail@max-inden.de>"]
edition = "2021"
description = "Open Metrics client library allowing users to natively instrument applications."
Expand All @@ -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 }

Expand Down
2 changes: 1 addition & 1 deletion 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 <mail@max-inden.de>"]
edition = "2021"
description = "Auxiliary crate to derive Encode trait from prometheus-client."
Expand Down

0 comments on commit c53d47b

Please sign in to comment.