Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: Prepare v0.19.0-alpha #113

Merged
merged 1 commit into from Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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