Update to latest actix-web.

This commit is contained in:
LukeMathWalker 2021-05-01 16:11:16 +01:00
parent a702e3a1d0
commit 07fa536146
3 changed files with 48 additions and 4 deletions

48
Cargo.lock generated
View file

@ -245,6 +245,17 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]]
name = "async-trait"
version = "0.1.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "atoi"
version = "0.4.0"
@ -1242,6 +1253,22 @@ dependencies = [
"vcpkg",
]
[[package]]
name = "opentelemetry"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b91cea1dfd50064e52db033179952d18c770cbc5dfefc8eba45d619357ba3914"
dependencies = [
"async-trait",
"futures",
"js-sys",
"lazy_static",
"percent-encoding",
"pin-project",
"rand 0.8.3",
"thiserror",
]
[[package]]
name = "parking_lot"
version = "0.11.1"
@ -2186,14 +2213,18 @@ dependencies = [
[[package]]
name = "tracing-actix-web"
version = "0.3.0-beta.3"
version = "0.4.0-beta.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f61ca5db1113b7b2ad09585d24d1143e940465596ba434ba19d506ee2ab28a1"
checksum = "d232c700ac99b41f56aac3832f138009b2dc7538cbdc76fdc6b8304a1ee2d2e0"
dependencies = [
"actix-http",
"actix-service",
"actix-web",
"futures",
"opentelemetry",
"tracing",
"tracing-futures",
"tracing-opentelemetry",
"uuid",
]
@ -2255,6 +2286,19 @@ dependencies = [
"tracing-core",
]
[[package]]
name = "tracing-opentelemetry"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99003208b647dae59dcefc49c98aecaa3512fbc29351685d4b9ef23a9218458e"
dependencies = [
"opentelemetry",
"tracing",
"tracing-core",
"tracing-log",
"tracing-subscriber",
]
[[package]]
name = "tracing-serde"
version = "0.1.2"

View file

@ -27,10 +27,10 @@ tracing-futures = "0.2.4"
tracing-subscriber = { version = "0.2.12", features = ["registry", "env-filter"] }
tracing-bunyan-formatter = "0.1.6"
tracing-log = "0.1.1"
tracing-actix-web = "0.3.0-beta.2"
serde-aux = "1.0.1"
unicode-segmentation = "1.7.1"
validator = "0.12.0"
tracing-actix-web = "0.4.0-beta.4"
[dev-dependencies]
reqwest = { version = "0.11", features = ["json"] }

View file

@ -10,7 +10,7 @@ pub fn run(listener: TcpListener, db_pool: PgPool) -> Result<Server, std::io::Er
let db_pool = Data::new(db_pool);
let server = HttpServer::new(move || {
App::new()
.wrap(TracingLogger)
.wrap(TracingLogger::default())
.route("/health_check", web::get().to(health_check))
.route("/subscriptions", web::post().to(subscribe))
.app_data(db_pool.clone())