fixup cargo toml, update readme for prometheus http client
This commit is contained in:
Generated
+15
-1
@@ -1857,6 +1857,20 @@ version = "1.3.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "signal-cli-jsonrpc-client"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"futures-util",
|
||||||
|
"jsonrpsee",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"thiserror",
|
||||||
|
"tokio",
|
||||||
|
"tokio-util",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "signal-gateway"
|
name = "signal-gateway"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -1869,7 +1883,6 @@ dependencies = [
|
|||||||
"displaydoc",
|
"displaydoc",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"humantime",
|
"humantime",
|
||||||
"jsonrpsee",
|
|
||||||
"metrics",
|
"metrics",
|
||||||
"prometheus-http-client",
|
"prometheus-http-client",
|
||||||
"rand",
|
"rand",
|
||||||
@@ -1877,6 +1890,7 @@ dependencies = [
|
|||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
"signal-cli-jsonrpc-client",
|
||||||
"signal-gateway-assistant",
|
"signal-gateway-assistant",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ rand = "0.9"
|
|||||||
flate2 = "1"
|
flate2 = "1"
|
||||||
regex = "1"
|
regex = "1"
|
||||||
tar = "0.4"
|
tar = "0.4"
|
||||||
prometheus-http-query = { version = "0.8", default-features = false }
|
|
||||||
reqwest = { version = "0.12", default-features = false, features = ["json"] }
|
reqwest = { version = "0.12", default-features = false, features = ["json"] }
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
|
|||||||
@@ -1,13 +1,34 @@
|
|||||||
# prometheus-http-client
|
# prometheus-http-client
|
||||||
|
|
||||||
Makes requests to the prometheus query API. With `plot` feature, also provides
|
Makes requests to the prometheus query API. With `plot` feature, also provides
|
||||||
a way to plot resposnes from prometheus.
|
a way to plot responses from prometheus.
|
||||||
|
|
||||||
*Note*: There are many prometheus query clients for rust -- I only made another because
|
## Why a custom implementation?
|
||||||
I thought I only needed one or two routes so I would just use `reqwest` directly.
|
|
||||||
|
|
||||||
Over time it has grown and now I feel a bit silly.
|
There are several prometheus query clients for Rust, but none quite fit the requirements:
|
||||||
|
|
||||||
This should probably be replaced
|
### [`prometheus-http-query`](https://docs.rs/prometheus-http-query)
|
||||||
with [`prometheus-http-query`](https://docs.rs/prometheus-http-query/latest/prometheus_http_query/)
|
|
||||||
or one of the other competitors, except for the plotting functionality.
|
The most complete and actively maintained option. However, it uses a structured
|
||||||
|
`Selector` builder that doesn't support raw PromQL selector strings. This means
|
||||||
|
queries like `__name__=~"http_.*"` or complex label matchers must be constructed
|
||||||
|
programmatically rather than passed as strings. For use cases where selectors
|
||||||
|
come from configuration files or user input, this is a significant limitation.
|
||||||
|
|
||||||
|
### [`prometheus-http-api`](https://docs.rs/prometheus-http-api)
|
||||||
|
|
||||||
|
Supports raw selector strings, which is great. However, it only implements
|
||||||
|
instant and range queries (`/api/v1/query` and `/api/v1/query_range`). It lacks
|
||||||
|
support for `/api/v1/series`, `/api/v1/labels`, `/api/v1/label/.../values`,
|
||||||
|
and `/api/v1/alerts` endpoints that this crate uses.
|
||||||
|
|
||||||
|
### [`proq`](https://docs.rs/proq) / [`prometheus-query`](https://docs.rs/prometheus-query)
|
||||||
|
|
||||||
|
Both are unmaintained (last updates 4+ years ago) and use outdated dependencies
|
||||||
|
like `tokio 0.1` and `hyper 0.12`.
|
||||||
|
|
||||||
|
### This crate
|
||||||
|
|
||||||
|
This implementation supports both raw PromQL selector strings and the full set of
|
||||||
|
API endpoints needed (query, query_range, series, labels, label values, alerts).
|
||||||
|
The `plot` feature adds time-series visualization using plotters.
|
||||||
|
|||||||
Reference in New Issue
Block a user