Skip to content

Commit 09896cf

Browse files
authored
Merge branch 'master' into metrics/expiry
2 parents cb64ace + 9a74e99 commit 09896cf

File tree

9 files changed

+290
-133
lines changed

9 files changed

+290
-133
lines changed

CHANGELOG.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ 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.23.0] - unreleased
7+
## [0.23.1] - unreleased
88

9+
### Changed
10+
11+
- `Histogram::new` now accepts an `IntoIterator` argument, rather than an `Iterator`.
12+
See [PR 243].
13+
14+
[PR 243]: https://github.com/prometheus/client_rust/pull/243
15+
16+
## [0.23.0]
917

1018
### Changed
1119

@@ -18,8 +26,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1826
- Implement `Atomic<u64>` for `AtomicU64` for gauges.
1927
See [PR 226].
2028

21-
[PR 226]: https://github.com/prometheus/client_rust/pull/198
29+
- Implement `EnableLabelValue` for `bool`.
30+
See [PR 237]
31+
32+
[PR 173]: https://github.com/prometheus/client_rust/pull/173
2233
[PR 198]: https://github.com/prometheus/client_rust/pull/198
34+
[PR 226]: https://github.com/prometheus/client_rust/pull/226
35+
[PR 237]: https://github.com/prometheus/client_rust/pull/237
2336

2437
### Added
2538

@@ -29,9 +42,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2942
- Supoort `Arc<String>` for `EncodeLabelValue`.
3043
See [PR 217].
3144

45+
- Add `histogram::exponential_buckets_range`.
46+
See [PR 233].
47+
48+
- Added `get` method to `Family`.
49+
See [PR 234].
50+
3251
[PR 173]: https://github.com/prometheus/client_rust/pull/173
3352
[PR 216]: https://github.com/prometheus/client_rust/pull/216
3453
[PR 217]: https://github.com/prometheus/client_rust/pull/217
54+
[PR 233]: https://github.com/prometheus/client_rust/pull/233
55+
[PR 234]: https://github.com/prometheus/client_rust/pull/234
3556

3657
### Fixed
3758

CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Contributing
2+
3+
## Protocol Buffers
4+
5+
The `build.rs` script in this library depends upon the
6+
[Protocol Buffers compiler][protoc]. Be sure that `protoc` is installed and
7+
available within your `PATH`.
8+
9+
[protoc]: https://docs.rs/prost-build/latest/prost_build/#sourcing-protoc
10+
11+
## Python Dependencies
12+
13+
This repository uses the [`prometheus-client`][client-python] Python client
14+
library in its test suite.
15+
16+
You may create and activate a virtual environment with this dependency
17+
installed by running the following shell commands from the root of this
18+
repository:
19+
20+
```shell
21+
python -m venv ./venv
22+
source venv/bin/activate
23+
pip install prometheus-client
24+
```
25+
26+
[client-python]: https://github.com/prometheus/client_python

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "prometheus-client"
3-
version = "0.23.0"
3+
version = "0.23.1"
44
authors = ["Max Inden <mail@max-inden.de>"]
55
edition = "2021"
66
description = "Open Metrics client library allowing users to natively instrument applications."
@@ -29,6 +29,7 @@ prost-types = { version = "0.12.0", optional = true }
2929
async-std = { version = "1", features = ["attributes"] }
3030
axum = "0.7"
3131
criterion = "0.5"
32+
futures = "0.3"
3233
http-types = "2"
3334
pyo3 = "0.22"
3435
quickcheck = "1"

examples/hyper.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use futures::future::BoxFuture;
12
use http_body_util::{combinators, BodyExt, Full};
23
use hyper::{
34
body::{Bytes, Incoming},
@@ -8,10 +9,8 @@ use hyper::{
89
use hyper_util::rt::TokioIo;
910
use prometheus_client::{encoding::text::encode, metrics::counter::Counter, registry::Registry};
1011
use std::{
11-
future::Future,
1212
io,
1313
net::{IpAddr, Ipv4Addr, SocketAddr},
14-
pin::Pin,
1514
sync::Arc,
1615
};
1716
use tokio::{
@@ -69,8 +68,7 @@ type BoxBody = combinators::BoxBody<Bytes, hyper::Error>;
6968
/// This function returns a HTTP handler (i.e. another function)
7069
pub fn make_handler(
7170
registry: Arc<Registry>,
72-
) -> impl Fn(Request<Incoming>) -> Pin<Box<dyn Future<Output = io::Result<Response<BoxBody>>> + Send>>
73-
{
71+
) -> impl Fn(Request<Incoming>) -> BoxFuture<'static, io::Result<Response<BoxBody>>> {
7472
// This closure accepts a request and responds with the OpenMetrics encoding of our metrics.
7573
move |_req: Request<Incoming>| {
7674
let reg = registry.clone();

0 commit comments

Comments
 (0)