Skip to content

Commit a7eb4b9

Browse files
committed
feat: introduce test-util feature flag
for background, see discussion in prometheus#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. \- <prometheus#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 <git@katelyn.world>
1 parent 6bb0b10 commit a7eb4b9

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Cargo.toml

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

17+
# This feature provides additional interfaces for testing.
18+
#
19+
# NB: Interfaces gated by this feature flag are not subject to stability
20+
# guarantees and may be changed or removed in patch releases.
21+
test-util = []
22+
1723
[workspace]
1824
members = ["derive-encode"]
1925

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 interfaces, such as accessors, to facilitate integration and
83+
//! unit testing of metrics. Note that interfaces gated by this feature flag are not subject to
84+
//! stability 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)