Skip to content

Commit ec3a549

Browse files
committed
feat: introduce test-util feature flag
for background, see discussion in #242: > > Would you be amenable to feature-gating these public helpers behind > > a `test-util` feature? This is a pretty common approach we've seen > > in other crates. > > That sounds reasonable to me. Contribution welcome. Thanks. Please > point out very prominently that we might break any of those APIs in > a patch release. \- <#242 (comment)> this commit introduces a `test-util` feature flag. this feature flag will function as a gate for additional interfaces, such as accessors to read the value of a histogram, that facilitate integration tests inspecting metrics. comments note that any forthcoming interfaces included by this feature are not subject to stability guarantees. Signed-off-by: katelyn martin <[email protected]>
1 parent 6bb0b10 commit ec3a549

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ documentation = "https://docs.rs/prometheus-client"
1414
default = []
1515
protobuf = ["dep:prost", "dep:prost-types", "dep:prost-build"]
1616

17+
# This feature provides additional APIs for testing downstream code using
18+
# `prometheus-client`.
19+
#
20+
# Note: Interfaces gated by this feature flag are not subject to stability
21+
# guarantees and may be changed or removed in patch releases.
22+
test-util = []
23+
1724
[workspace]
1825
members = ["derive-encode"]
1926

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@
7777
//! ```
7878
//! See [examples] directory for more.
7979
//!
80+
//! # Features
81+
//!
82+
//! The `test-util` gates additional APIs, such as accessors, to facilitate integration and unit
83+
//! testing of metrics. Note that APIs gated by this feature flag are not subject to stability
84+
//! guarantees and may be changed or removed in patch releases.
85+
//!
8086
//! [examples]: https://github.com/prometheus/client_rust/tree/master/examples
8187
8288
pub mod collector;

0 commit comments

Comments
 (0)