-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trait Trait
Reply is not implemented for
PrometheusResponse [E0277]
is not implemented for PrometheusResponse
[E0277]
#181
Comments
Hey! We upgraded autometrics in version 1.0.1 to use You've got multiple ways to work around this:
#[autometrics]
async fn metrics_handler() -> Result<impl warp::Reply, warp::Rejection> {
match autometrics::prometheus_exporter::encode_to_string() {
Ok(metrics) => Ok(metrics),
Err(_) => Err(warp::reject::not_found()),
}
}
# note the `=` at the beginning of the version pinning it to 1.0.0, as 1.0.1 upgraded the `http` version
autometrics = { version = "=1.0.0", features = ["prometheus-exporter"] } let routes = warp::get()
.and(warp::path("metrics"))
.and(warp::path::end())
.map(|| prometheus_exporter::encode_http_response()); We personally recommend the first variant so that you can take advantage of all the latest features and don't have to consult outdated documentation. Once |
Thank you; When I do the recommended workaround, with the updated hander, I've instrumented an rGPC service according to the code example in the repo, Maybe a good idea to update the gRPC example to version 2, as it still hangs on V1.0.0 Has the configuration changed or is there something else I have to know to make autometrics work with tonic gRPC? |
do you have a repo or reproduceable example i could take a look at? ill update the grpc-http example to use autometrics 2.0 |
@mellowagain Thank you so much for your help. However, I had to remove autometrics from my project due to multiple issues during a complex I am not filling an issue for that because the setup is so far above and beyond the normal range that it is totally not worth fixing. Closing this for good. |
autometrics = { version = "2.0.0", features = ["prometheus-exporter"] }
warp = "0.3"
Rust = 1.80
When configuring autometrics with warp, the compiler thows an error stating the Trait
Reply
is not implemented forPrometheusResponse
.Repro:
When I wrap the Prometheus exporter in a Warp Reply, only the string encodind works, but then the code compiles without exporting metrics.
I am a bit puzzled here. Is warp not supported?
The text was updated successfully, but these errors were encountered: