This allows us to call add_custom_metadata() on both conduit::RequestExt and http::Request
see https://github.com/rust-lang/crates.io/commit/0ef1e2b84a11e4d569acfad7cf9b4ef8bd730148
This will make it easier to access the value from axum-based middlewares.
Just like some of the previous PRs, this PR is migrating yet another conduit-based middleware to be an axum middleware instead :)
These tests have been quite flaky on CI lately, so maybe increasing the timeout will fix the issue… 🤷♂️
This PR ports our normalize_path middleware from conduit to axum.
Since this middleware needs to run before the axum Router is involved, it needs to be wrapped around the router as suggested by https://docs.rs/axum/0.6.1/axum/…
This moves our axum middleware stack building code into the middleware module, right next to similar code for the conduit middlewares.
We have all of these metrics in Prometheus/Grafana already, so there is no need anymore for them to clutter up our logs :)
This PR drops the logging part of the conduit middleware and uses the axum middleware for it instead, which is now on par with the conduit implementation.
In the world of axum request handlers are not (really) allowed to return errors, so we need to rethink how conduit handler errors can be passed to the axum middleware. Since we already support custom metadata we can convert an `Err…
This requires us to go back to putting custom metadata in a request extension, but this time we're putting it in a Arc<Mutex<Vec>> to make it extra complicated… and compatible with axum middlewares 😅
This is meant to eventually replace the equivalent conduit middleware once it is feature complete. Until then we only log with debug level, which does not show up in production logs.
The two missing pieces are custom metadata and …
Using add_custom_metadata() in the email code makes it hard to port the log_request middleware to axum, due to the CUSTOM_METADATA thread local which appears to be hard to migrate into the async world. The easiest solution for now …
This PR essentially reverts #3399, after #5655 has shown that using the existing req.elapsed() is as good of a guess as using the X-Request-Start header.
This has the side effect of slightly simplifying the migration of the `log_re…
Reverts rust-lang/crates.io#5655
I've seen enough… 😅
The result of this experiment is that nginx_time was actually negative in all cases where it was logged, which essentially means that req.elapsed() is as good of a guess a…
https://github.com/rust-lang/crates.io/pull/3399 added support for including the nginx processing time in the response time calculation, but we currently don't know what exactly the overhead of the nginx processing is. This PR adds an ad…
This PR switches the Sentry integration to the official sentry-tower crate and integrates it with the axum server and our conduit-axum glue code.
We don't want http logging to clutter the error reporting. These errors are not deduplicated properly, because they contain the request ID and other unique things in the error message.
This should temporarily resolve https://github.com/rust-lang/crates.io/issues/5646 until we figure out what exactly went wrong and why the background worker still seems to be running correctly despite the Sentry error reports.