Releases: puetzp/prometheus-http-query
Releases · puetzp/prometheus-http-query
v0.6.2
v0.6.1
v0.6.0
v0.5.2
v0.5.1
v0.5.0
Changed
QueryResultType
->PromqlResult
- JSON returned from
/api/v1/alertmanagers
is now parsed asAlertmanagers { active: Vec<Alertmanager>, dropped: Vec<Alertmanager> }
Selector::with
->Selector::eq
Selector::without
->Selector::ne
Selector::regex_match
->Selector::regex_eq
Selector::no_regex_match
->Selector::regex_ne
Target.scrape_interval
fromString
totime::Duration
Target.scrape_timeout
fromString
totime::Duration
- Function signature of
Client::query
: fromquery(&self, vector: impl Display, time: Option<i64>, timeout: Option<&str>)
toquery(&self, query: impl ToString, time: Option<i64>, timeout: Option<i64>)
- Function signature of
Client::query_range
: fromquery_range(&self, vector: impl Display, start: i64, end: i64, step: &str, timeout: Option<&str>)
toquery_range(&self, query: impl ToString, start: i64, end: i64, step: f64, timeout: Option<i64>)
Error::ResponseError
->Error::ApiError
Error::Reqwest
->Error::Client
Added
- type
Alertmanager
that currently just wrapsurl::Url
since this is the only item returned from the/api/v1/alertmanagers
endpoint as yet. Client::build_information
returningBuildInformation
Client::runtime_information
returningRuntimeInformation
- convenience functions:
prometheus_http_query::query
prometheus_http_query::query_range
prometheus_http_query::series
prometheus_http_query::label_names
prometheus_http_query::label_values
prometheus_http_query::targets
prometheus_http_query::rules
prometheus_http_query::flags
prometheus_http_query::alertmanagers
prometheus_http_query::build_information
prometheus_http_query::runtime_information
prometheus_http_query::target_metadata
prometheus_http_query::metric_metadata
Removed
functions
module,aggregations
module, allSelector
functionality that relates to gradual building of PromQL queries.- Obsolete variants of the
Error
enum
v0.4.2
v0.4.1
Changed
- Aligned validation of time duration with the go implementation (e.g. the total value in nanoseconds must not exceed
i64::MAX
)
v0.4.0
Added
- Create a
Client
from a string literal viaClient::from_str()
orClient::try_from()
, from aString
viaClient::try_from()
. - Add trigonometric functions.
- Add
QueryResultType::Scalar
.
Changed
- Repurpose
Client::from()
to create aClient
from a custom-builtreqwest::Client
plus a base URL, so authentication, proxy settings etc. may be customized by the user. Selector::metric()
is not fallible anymore. Metric names that equal reserved Prometheus keywords like "on" can now be queried.
Removed
Client::new()
Error::IllegalMetricName
Fixed
- As yet
prometheus_http_query::functions::scalar
could not possibly return a result. An error would be thrown inevitably. The query result will now correctly be aQueryResultType::Scalar(Sample)
that can be extracted byQueryResultType::as_scalar()
.