Skip to content

v0.3.0

Choose a tag to compare

@puetzp puetzp released this 10 Jul 13:31
· 257 commits to master since this release

Changed

  • Remove the Response type.
  • Rename response::Group to response::RuleGroup
  • Rename Client::labels() -> Client::label_names()
  • Deserialize scrapeUrl and globalUrl in a target as url::Url instead of String; Target::scrape_url() and Target::global_url() now return &Urls
  • Deserialize lastScrape (target) and activeAt (alert) as time::OffsetDateTime instead of String; Target::last_scrape() and Alert::active_at() now return &OffsetDateTimes
  • Client::query() and Client::query_range() now return a QueryResultType enum with Variants Vector and Matrix that encapsulate a vector of InstantVectors and RangeVectors respectively.
  • all other Client methods' response types are not wrapped into Response anymore as the return type of these methods is fixed.
  • Rename error::UnsupportedResponseDataType to UnsupportedQueryResultType that is only thrown when a expression query result cannot be parsed as QueryResultType.

Added

  • Client::flags() to retrieve flags that Prometheus was configured with.
  • Client::alertmanagers() to retrieve current alertmanager discovery status.
  • Client::target_metadata() to retrieve metric metadata along with target information.
  • Client::metric_metadata() to retrieve metric metadata.
  • error::ResponseParse as generic wrapper around serde_json::Error.
  • error::MissingField to avoid panics when API response (for whatever reason) does not contain documented and thus expected fields.

Some convenience methods to retrieve the expected type of data from a QueryResultType:

  • QueryResultType.as_instant()
  • QueryResultType.as_range()