Skip to content

Commit e62a619

Browse files
committed
Merge branch 'master' into ftorres/utf-8
2 parents b0d7ae2 + 93c63db commit e62a619

File tree

8 files changed

+226
-127
lines changed

8 files changed

+226
-127
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- Implement `Atomic<u64>` for `AtomicU64` for gauges.
1919
See [PR 226].
2020

21-
[PR 226]: https://github.com/prometheus/client_rust/pull/198
21+
- Implement `EnableLabelValue` for `bool`.
22+
See [PR 237]
23+
24+
[PR 173]: https://github.com/prometheus/client_rust/pull/173
2225
[PR 198]: https://github.com/prometheus/client_rust/pull/198
26+
[PR 226]: https://github.com/prometheus/client_rust/pull/226
27+
[PR 237]: https://github.com/prometheus/client_rust/pull/237
2328

2429
### Added
2530

@@ -29,9 +34,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2934
- Supoort `Arc<String>` for `EncodeLabelValue`.
3035
See [PR 217].
3136

37+
- Added `get` method to `Family`.
38+
See [PR 234].
39+
3240
[PR 173]: https://github.com/prometheus/client_rust/pull/173
3341
[PR 216]: https://github.com/prometheus/client_rust/pull/216
3442
[PR 217]: https://github.com/prometheus/client_rust/pull/217
43+
[PR 234]: https://github.com/prometheus/client_rust/pull/234
3544

3645
### Fixed
3746

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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)