NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #4445 most downloaded on crates.io
Prometheus HTTP API client
Last release 5 months ago
09 May 2026
Ships unpredictably
gaps range from 2 weeks to 2.1 years
Some releases are documented
notes for 14 of 29 stable releases
1 version withdrawn
withdrawn after publishing
5 years old
30 releases · first in 2021
One column per quarter.
Thank you @scvalex and @drbrain for the contributions!
reqwest to avoid having to manage multiple, possibly conflicting dependencies to the same crate in a user's Cargo.toml (thanks to @svcalex via pull request)reqwest in Cargo.toml to 0.13 (thanks to @drbrain via pull request)0.8.4See CHANGELOG Thanks to @chris13524
See CHANGELOG
Thanks to @chris13524
reqwest to v12.x (@chris13524 via pull request)url to v2.5See CHANGELOG Thanks to @alesharik !
See CHANGELOG
Thanks to @alesharik !
InstantQueryBuilder::queryRangeQueryBuilder::queryAll changes by courtesy of @alesharik via pull request.
See CHANGELOG Thanks to @VoltaireNoir !
See CHANGELOG
Thanks to @VoltaireNoir !
InstantQueryBuilder::get_rawInstantQueryBuilder::post_rawRangeQueryBuilder::get_rawRangeQueryBuilder::post_rawLabelNamesQueryBuilder::get_rawLabelValuesQueryBuilder::get_rawMetricMetadataQueryBuilder::get_rawRulesQueryBuilder::get_rawSeriesQueryBuilder::get_rawTargetMetadataQueryBuilder::get_rawAll changes by courtesy of @VoltaireNoir via pull request.
See CHANGELOG Thanks to @VoltaireNoir !
See CHANGELOG
Thanks to @VoltaireNoir !
Copy on SampleData::as_vector_mutData::as_matrix_mutData::as_scalar_mutData::into_vectorData::into_matrixData::into_samplePromqlResult::into_innerData::as_vector returns Option<&Vec<InstantVector>> nowData::as_matrix returns Option<&Vec<RangeVector>> nowNote that this is technically a breaking release due to the altered function signatures of the two functions above. These functions formerly returned Option<&[InstantVector]>. However thanks to Rust's type coercions rules the changes are actually not expected to break any code, since the returned vector is yet again coerced to a slice when accessed immutably.
All changes by courtesy of @VoltaireNoir via pull request.
See CHANGELOG
See CHANGELOG
See CHANGELOG
RuleGroup::limit()RuleGroup::last_evaluation()RuleGroup::evaluation_time()AlertingRule::last_evaluation()AlertingRule::evaluation_time()RecordingRule::last_evaluation()RecordingRule::evaluation_time()Rule::as_recording()Rule::as_alerting()impl Eq for RuleHealthRuleHealth::is_good()RuleHealth::is_bad()RuleHealth::is_unknown()impl Eq for AlertStateAlertState::is_inactive()AlertState::is_pending()AlertState::is_firing()impl Eq for TargetHealthTargetHealth::is_up()TargetHealth::is_down()TargetHealth::is_unknown()impl Eq for MetricTypeMetricType::is_counter()MetricType::is_gauge()MetricType::is_histogram()MetricType::is_gauge_histogram()MetricType::is_summary()MetricType::is_info()MetricType::is_stateset()MetricType::is_unknown()AlertingRule::keep_firing_for()impl Eq for WalReplayStateWalReplayState::is_waiting()WalReplayState::is_in_progress()WalReplayState::is_done()Among other changes some Client methods have been refactored and return "builders" (like Client::query and Client::query_range already did) to gradually build a query to the respective endpoint instead of having to pass a lot of arguments to a single function and also having to pass None a lot to use the "default" functionality of the given Prometheus API endpoint.
The following Client methods were refactored in that fashion:
Client::rules()Client::target_metadata()Client::metric_metadata()Client::series()Client::label_names()Client::label_values()Other changes include:
RuleType to RuleKind and its variants from Alert and Record to Alerting and Recording.Alert::value() now returns f64.Client::query, Client::query_range direct::query and direct::query_range now require the PromQl query string to implement std::fmt::Display instead of std::string::ToString.serde_json could be removed.error module and some custom errors related to deserialization using serde::de::Error. The Error enum inside the error module now contains one variant less and existing error variants were improved by properly implementing std::error::Error::source(). Libraries like anyhow are now able to display more detailed error messages. This change is not breaking if you did not match on specific error enum variants before.Client methods now return a more concise error if the server response (from Prometheus or an intermediate proxy) does not contain a Content-Type header identifying the payload as JSON, that is the media type from the response is not as expected.See CHANGELOG
See CHANGELOG
Content-Type: application/json; charset=utf-8 (see issue)See CHANGELOG
See CHANGELOG
InstantQueryBuilder::header and RangeQueryBuilder::header (see also PR #6, thank you @lasantosr)See CHANGELOG
See CHANGELOG
reqwest by the same name.Nothing published for this version
### Added - Client::is_server_healthy - Client::is_server_ready ### Changed - Update crate url to v2.3
Client::is_server_healthyClient::is_server_readyurl to v2.3prometheus_http_query::ApiErrorType that corresponds to the error variants that are used within the Prometheus API code.
prometheus_http_query::error::ApiErrorType that corresponds to the error variants that are used within the Prometheus API code.prometheus_http_query::error::ApiError is now part of the public crate API and provides methods to inspect the cause of the error, e.g. ApiError::error_type, ApiError::is_timeout and ApiError::message.Client methods now return the proper error variant when e.g. a reverse proxy acts as intermediary. This considers the following three cases:
Result::Ok.ApiError containing the error details within Result::Err.reqwest::Error within Result::Err.All Client methods now properly return prometheus_http_query::ApiError when Prometheus responds with an HTTP 4xx and the error type and message are ca
Client methods now properly return prometheus_http_query::error::ApiError when Prometheus responds with an HTTP 4xx and the error type and message are captured.Client::query and Client::query_range now return builder types to add parameters to a request (e.g. timeout) before sending the request via InstantQue
Client::query and Client::query_range now return builder types to add parameters to a request (e.g. timeout) before sending the request via InstantQueryBuilder::get or InstantQueryBuilder::post and their pendants in RangeQueryBuilder. The purpose is to reduce the number of parameters in e.g. Client::query and configure a request via a builder instead as the number of parameters will certainly increase in the future.InstantQueryBuilder::get, InstantQueryBuilder::post and their RangeQueryBuilder pendants still return a Result<PromqlResult, _>, but the Promqlresult now contains data and stats. The former being the familiar collection of vectors or matrices, the latter the execution stats as returned by the HTTP API.Client::base_url now returns UrlPromqlResult::as_instant -> Data::as_vectorPromqlResult::as_range -> Data::as_matrixPromqlResult::as_scalar -> Data::as_scalarInstantQueryBuilder and RangeQueryBuilder. Each allows to set additional optional parameters to a request (e.g. a timeout). Request can then be sent using HTTP GET (see InstantQueryBuilder::get) or POST (see InstantQueryBuilder::post).InstantQueryBuilder::stats and RangeQueryBuilder::stats as the first new query parameter/builder method. Use it to request query execution stats from Prometheus as part of the PromqlResult when get or post are executed. See this pull request for details and background information.PromqlResult::dataPromqlResult::statsNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →