Skip to content

Commit

Permalink
Update README and CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
puetzp committed Oct 13, 2023
1 parent 24fd4a7 commit 7e7e107
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()`
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand All @@ -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").
Expand All @@ -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(())
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7e7e107

Please sign in to comment.