diff --git a/CHANGELOG.md b/CHANGELOG.md index fcf80cb..2b6c761 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.7.0] - unreleased +## [0.7.0] - 2023-10-13 ### Added - `RuleGroup::limit()` - `RuleGroup::last_evaluation()` diff --git a/README.md b/README.md index 2d50a2b..53517ad 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This crate provides an interface to the [Prometheus HTTP API](https://prometheus ## Example ```rust -use prometheus_http_query::{Client, Error, Selector, RuleType}; +use prometheus_http_query::{Client, Error, Selector, RuleKind}; #[tokio::main(flavor = "current_thread")] async fn main() -> Result<(), Error> { @@ -21,7 +21,7 @@ async fn main() -> Result<(), Error> { assert!(alerts.is_ok()); // Retrieve recording rules. - let recording_rules = client.rules(Some(RuleType::Record)).await; + let recording_rules = client.rules().kind(RuleKind::Recording).get().await; assert!(recording_rules.is_ok()); // Retrieve a list of time series that match certain labels sets ("series selectors"). @@ -32,7 +32,7 @@ async fn main() -> Result<(), Error> { .eq("job", "node") .regex_eq("mode", ".+"); - let time_series = client.series(&[select1, select2], None, None).await; + let time_series = client.series(&[select1, select2]).get().await; assert!(time_series.is_ok()); Ok(()) @@ -41,7 +41,7 @@ async fn main() -> Result<(), Error> { ## Compatibility -This library is generally compatible with Prometheus versions starting from v2.30. Individual client methods might fail with older versions. +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. ## Tests diff --git a/src/client.rs b/src/client.rs index ad18330..d7ec39e 100644 --- a/src/client.rs +++ b/src/client.rs @@ -148,8 +148,8 @@ pub struct RulesQueryBuilder { /// be set: [Prometheus API documentation](https://prometheus.io/docs/prometheus/latest/querying/api/#rules). impl RulesQueryBuilder { /// Set this to instruct Prometheus to only return a specific type of rule - /// (either recording or alerting rules). Calling this repeatedly will replace - /// the current setting. + /// (either recording or alerting rules) instead of both. Calling this repeatedly + /// will replace the current setting. pub fn kind(mut self, kind: RuleKind) -> Self { self.kind = Some(kind); self