Skip to content

Commit 7e7e107

Browse files
committed
Update README and CHANGELOG
1 parent 24fd4a7 commit 7e7e107

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ 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.7.0] - unreleased
7+
## [0.7.0] - 2023-10-13
88
### Added
99
- `RuleGroup::limit()`
1010
- `RuleGroup::last_evaluation()`

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This crate provides an interface to the [Prometheus HTTP API](https://prometheus
55
## Example
66

77
```rust
8-
use prometheus_http_query::{Client, Error, Selector, RuleType};
8+
use prometheus_http_query::{Client, Error, Selector, RuleKind};
99

1010
#[tokio::main(flavor = "current_thread")]
1111
async fn main() -> Result<(), Error> {
@@ -21,7 +21,7 @@ async fn main() -> Result<(), Error> {
2121
assert!(alerts.is_ok());
2222

2323
// Retrieve recording rules.
24-
let recording_rules = client.rules(Some(RuleType::Record)).await;
24+
let recording_rules = client.rules().kind(RuleKind::Recording).get().await;
2525
assert!(recording_rules.is_ok());
2626

2727
// Retrieve a list of time series that match certain labels sets ("series selectors").
@@ -32,7 +32,7 @@ async fn main() -> Result<(), Error> {
3232
.eq("job", "node")
3333
.regex_eq("mode", ".+");
3434

35-
let time_series = client.series(&[select1, select2], None, None).await;
35+
let time_series = client.series(&[select1, select2]).get().await;
3636
assert!(time_series.is_ok());
3737

3838
Ok(())
@@ -41,7 +41,7 @@ async fn main() -> Result<(), Error> {
4141

4242
## Compatibility
4343

44-
This library is generally compatible with Prometheus versions starting from v2.30. Individual client methods might fail with older versions.
44+
This library is generally compatible with Prometheus versions starting from v2.30. Individual client methods might fail with older versions as newer versions of Prometheus server support additional methods and query parameters. Run Prometheus server version >= 2.46 to ensure maximum compatibility.
4545

4646
## Tests
4747

src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ pub struct RulesQueryBuilder {
148148
/// be set: [Prometheus API documentation](https://prometheus.io/docs/prometheus/latest/querying/api/#rules).
149149
impl RulesQueryBuilder {
150150
/// Set this to instruct Prometheus to only return a specific type of rule
151-
/// (either recording or alerting rules). Calling this repeatedly will replace
152-
/// the current setting.
151+
/// (either recording or alerting rules) instead of both. Calling this repeatedly
152+
/// will replace the current setting.
153153
pub fn kind(mut self, kind: RuleKind) -> Self {
154154
self.kind = Some(kind);
155155
self

0 commit comments

Comments
 (0)