From dc276c715060ec3c892d2b0a4694415840fc5da8 Mon Sep 17 00:00:00 2001 From: Aumetra Weisman Date: Sat, 11 May 2024 23:00:49 +0200 Subject: [PATCH] remove opentelemetry for now --- Cargo.lock | 385 ++++-------------------- Cargo.toml | 1 - crates/kitsune-observability/Cargo.toml | 16 - crates/kitsune-observability/src/lib.rs | 23 +- lib/http-compat/Cargo.toml | 13 - lib/http-compat/LICENSE-APACHE-2.0 | 1 - lib/http-compat/LICENSE-MIT | 1 - lib/http-compat/src/lib.rs | 8 - lib/http-compat/src/v0_2.rs | 74 ----- lib/http-compat/src/v1.rs | 64 ---- 10 files changed, 72 insertions(+), 514 deletions(-) delete mode 100644 lib/http-compat/Cargo.toml delete mode 120000 lib/http-compat/LICENSE-APACHE-2.0 delete mode 120000 lib/http-compat/LICENSE-MIT delete mode 100644 lib/http-compat/src/lib.rs delete mode 100644 lib/http-compat/src/v0_2.rs delete mode 100644 lib/http-compat/src/v1.rs diff --git a/Cargo.lock b/Cargo.lock index 9f77a1487..cc2e5880a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -264,8 +264,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a41603f7cdbf5ac4af60760f17253eb6adf6ec5b6f14a7ed830cf687d375f163" dependencies = [ "askama", - "axum-core 0.4.3", - "http 1.1.0", + "axum-core", + "http", ] [[package]] @@ -328,7 +328,7 @@ dependencies = [ "bytes", "fnv", "futures-util", - "http 1.1.0", + "http", "indexmap 2.2.6", "mime", "multer", @@ -356,7 +356,7 @@ checksum = "d94b2673899046dbbb803dff9c400330f7908727f5edb99979c3d841136ee754" dependencies = [ "async-graphql", "async-trait", - "axum 0.7.5", + "axum", "bytes", "futures-util", "serde_json", @@ -488,34 +488,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" -[[package]] -name = "axum" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" -dependencies = [ - "async-trait", - "axum-core 0.3.4", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", - "itoa 1.0.11", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper 0.1.2", - "tower", - "tower-layer", - "tower-service", -] - [[package]] name = "axum" version = "0.7.5" @@ -523,15 +495,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" dependencies = [ "async-trait", - "axum-core 0.4.3", + "axum-core", "axum-macros", "base64 0.21.7", "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", - "hyper 1.3.1", + "hyper", "hyper-util", "itoa 1.0.11", "matchit", @@ -555,23 +527,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "axum-core" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] - [[package]] name = "axum-core" version = "0.4.3" @@ -581,8 +536,8 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", "mime", "pin-project-lite", @@ -599,14 +554,14 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0be6ea09c9b96cb5076af0de2e383bd2bc0c18f827cf1967bdd353e0b910d733" dependencies = [ - "axum 0.7.5", - "axum-core 0.4.3", + "axum", + "axum-core", "bytes", "cookie", "futures-util", "headers", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", "mime", "pin-project-lite", @@ -625,11 +580,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1353f895919cf98d30146a7bb8e2275a5f096d1f6252be9101dbd29e8fe22e2f" dependencies = [ "async-trait", - "axum-core 0.4.3", + "axum-core", "axum-extra", "base64 0.21.7", "cookie", - "http 1.1.0", + "http", "serde", "serde_json", "tower-layer", @@ -1523,12 +1478,12 @@ version = "0.0.1-pre.6" dependencies = [ "aliri_braid", "async-trait", - "axum-core 0.4.3", + "axum-core", "blake3", "cookie", "futures-test", "hex-simd", - "http 1.1.0", + "http", "pin-project-lite", "rand 0.8.5", "tower", @@ -2440,25 +2395,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.4" @@ -2470,7 +2406,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 1.1.0", + "http", "indexmap 2.2.6", "slab", "tokio", @@ -2525,7 +2461,7 @@ dependencies = [ "base64 0.21.7", "bytes", "headers-core", - "http 1.1.0", + "http", "httpdate", "mime", "sha1", @@ -2537,7 +2473,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" dependencies = [ - "http 1.1.0", + "http", ] [[package]] @@ -2676,17 +2612,6 @@ dependencies = [ "syn 2.0.63", ] -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa 1.0.11", -] - [[package]] name = "http" version = "1.1.0" @@ -2698,17 +2623,6 @@ dependencies = [ "itoa 1.0.11", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.0" @@ -2716,7 +2630,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", - "http 1.1.0", + "http", ] [[package]] @@ -2727,19 +2641,11 @@ checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" dependencies = [ "bytes", "futures-core", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "pin-project-lite", ] -[[package]] -name = "http-compat" -version = "0.0.1-pre.6" -dependencies = [ - "http 0.2.12", - "http 1.1.0", -] - [[package]] name = "http-range-header" version = "0.4.1" @@ -2756,7 +2662,7 @@ dependencies = [ "const-oid", "derive_builder", "divan", - "http 1.1.0", + "http", "httpdate", "itertools 0.12.1", "logos 0.14.0", @@ -2800,30 +2706,6 @@ dependencies = [ "libm", ] -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa 1.0.11", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.3.1" @@ -2833,9 +2715,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.4", - "http 1.1.0", - "http-body 1.0.0", + "h2", + "http", + "http-body", "httparse", "httpdate", "itoa 1.0.11", @@ -2852,8 +2734,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "908bb38696d7a037a01ebcc68a00634112ac2bbf8ca74e30a2c3d2f4f021302b" dependencies = [ "futures-util", - "http 1.1.0", - "hyper 1.3.1", + "http", + "hyper", "hyper-util", "log", "rustls 0.23.5", @@ -2864,18 +2746,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "hyper-timeout" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" -dependencies = [ - "hyper 0.14.28", - "pin-project-lite", - "tokio", - "tokio-io-timeout", -] - [[package]] name = "hyper-util" version = "0.1.3" @@ -2885,9 +2755,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", + "http", + "http-body", + "hyper", "pin-project-lite", "socket2", "tokio", @@ -3189,7 +3059,7 @@ dependencies = [ "async-graphql-axum", "async-trait", "athena", - "axum 0.7.5", + "axum", "axum-extra", "axum-flash", "blowocking", @@ -3204,7 +3074,7 @@ dependencies = [ "fs_extra", "futures-util", "headers", - "http 1.1.0", + "http", "http-body-util", "http-signatures", "iso8601-timestamp", @@ -3283,9 +3153,9 @@ dependencies = [ "diesel-async", "futures-util", "headers", - "http 1.1.0", + "http", "http-body-util", - "hyper 1.3.1", + "hyper", "iso8601-timestamp", "kitsune-cache", "kitsune-config", @@ -3341,7 +3211,7 @@ name = "kitsune-captcha" version = "0.0.1-pre.6" dependencies = [ "enum_dispatch", - "http 1.1.0", + "http", "kitsune-error", "kitsune-http-client", "serde", @@ -3477,7 +3347,7 @@ dependencies = [ "diesel", "diesel-async", "embed-sdk", - "http 1.1.0", + "http", "iso8601-timestamp", "kitsune-db", "kitsune-derive", @@ -3492,10 +3362,10 @@ dependencies = [ name = "kitsune-error" version = "0.0.1-pre.6" dependencies = [ - "axum-core 0.4.3", + "axum-core", "eyre", "garde", - "http 1.1.0", + "http", "simd-json", "sync_wrapper 1.0.1", "tracing", @@ -3540,10 +3410,10 @@ dependencies = [ "async-stream", "bytes", "futures-util", - "http-body 1.0.0", + "http-body", "http-body-util", "http-signatures", - "hyper 1.3.1", + "hyper", "hyper-rustls", "hyper-util", "kitsune-type", @@ -3646,17 +3516,9 @@ dependencies = [ name = "kitsune-observability" version = "0.0.1-pre.6" dependencies = [ - "async-trait", "eyre", - "http-body-util", - "http-compat", - "hyper 1.3.1", "kitsune-config", - "kitsune-http-client", "opentelemetry", - "opentelemetry-http", - "opentelemetry-otlp", - "opentelemetry_sdk", "tracing", "tracing-error", "tracing-opentelemetry", @@ -3668,7 +3530,7 @@ name = "kitsune-oidc" version = "0.0.1-pre.6" dependencies = [ "enum_dispatch", - "http 1.1.0", + "http", "http-body-util", "kitsune-config", "kitsune-derive", @@ -3692,7 +3554,7 @@ version = "0.0.1-pre.6" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http", "kitsune-error", "kitsune-http-client", "kitsune-test", @@ -3725,7 +3587,7 @@ dependencies = [ "enum_dispatch", "futures-io", "futures-util", - "http 1.1.0", + "http", "kitsune-config", "kitsune-db", "kitsune-derive", @@ -3758,9 +3620,9 @@ dependencies = [ "futures-util", "garde", "hex-simd", - "http 1.1.0", + "http", "http-body-util", - "hyper 1.3.1", + "hyper", "img-parts", "iso8601-timestamp", "kitsune-activitypub", @@ -3829,7 +3691,7 @@ dependencies = [ "bytes", "diesel-async", "futures-util", - "http 1.1.0", + "http", "http-body-util", "isolang", "kitsune-config", @@ -3922,9 +3784,9 @@ version = "0.0.1-pre.6" dependencies = [ "async-trait", "futures-util", - "http 1.1.0", + "http", "http-body-util", - "hyper 1.3.1", + "hyper", "kitsune-cache", "kitsune-core", "kitsune-error", @@ -4542,7 +4404,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http 1.1.0", + "http", "httparse", "memchr", "mime", @@ -4687,7 +4549,7 @@ dependencies = [ "base64 0.22.1", "chrono", "getrandom 0.2.15", - "http 1.1.0", + "http", "rand 0.8.5", "serde", "serde_json", @@ -4746,7 +4608,7 @@ dependencies = [ "dyn-clone", "ed25519-dalek", "hmac", - "http 1.1.0", + "http", "itertools 0.10.5", "log", "oauth2", @@ -4787,56 +4649,6 @@ dependencies = [ "urlencoding", ] -[[package]] -name = "opentelemetry-http" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7690dc77bf776713848c4faa6501157469017eaf332baccd4eb1cea928743d94" -dependencies = [ - "async-trait", - "bytes", - "http 0.2.12", - "opentelemetry", -] - -[[package]] -name = "opentelemetry-otlp" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a016b8d9495c639af2145ac22387dcb88e44118e45320d9238fbf4e7889abcb" -dependencies = [ - "async-trait", - "futures-core", - "http 0.2.12", - "opentelemetry", - "opentelemetry-http", - "opentelemetry-proto", - "opentelemetry-semantic-conventions", - "opentelemetry_sdk", - "prost", - "thiserror", - "tokio", - "tonic", -] - -[[package]] -name = "opentelemetry-proto" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8fddc9b68f5b80dae9d6f510b88e02396f006ad48cac349411fbecc80caae4" -dependencies = [ - "opentelemetry", - "opentelemetry_sdk", - "prost", - "tonic", -] - -[[package]] -name = "opentelemetry-semantic-conventions" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9ab5bd6c42fb9349dcf28af2ba9a0667f697f9bdcca045d39f2cec5543e2910" - [[package]] name = "opentelemetry_sdk" version = "0.22.1" @@ -4848,15 +4660,12 @@ dependencies = [ "futures-channel", "futures-executor", "futures-util", - "glob", "once_cell", "opentelemetry", "ordered-float 4.2.0", "percent-encoding", "rand 0.8.5", "thiserror", - "tokio", - "tokio-stream", ] [[package]] @@ -4941,7 +4750,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3592c190977a91610618349bd947fec5bf10b2ca1cdc882f6623031de4cd34e1" dependencies = [ - "axum 0.7.5", + "axum", "oxide-auth", ] @@ -5404,29 +5213,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9554e3ab233f0a932403704f1a1d08c30d5ccd931adfdfa1e8b5a19b52c1d55a" -dependencies = [ - "anyhow", - "itertools 0.12.1", - "proc-macro2", - "quote", - "syn 2.0.63", -] - [[package]] name = "psm" version = "0.1.21" @@ -7077,16 +6863,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-macros" version = "2.2.0" @@ -7280,37 +7056,6 @@ dependencies = [ "winnow 0.6.8", ] -[[package]] -name = "tonic" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" -dependencies = [ - "async-stream", - "async-trait", - "axum 0.6.20", - "base64 0.21.7", - "bytes", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", - "hyper-timeout", - "percent-encoding", - "pin-project", - "prost", - "rustls-native-certs", - "rustls-pemfile", - "rustls-pki-types", - "tokio", - "tokio-rustls 0.25.0", - "tokio-stream", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tower" version = "0.4.13" @@ -7319,13 +7064,9 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap 1.9.3", "pin-project", "pin-project-lite", - "rand 0.8.5", - "slab", "tokio", - "tokio-util", "tower-layer", "tower-service", "tracing", @@ -7342,8 +7083,8 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", "http-range-header", "httpdate", @@ -7369,8 +7110,8 @@ dependencies = [ "bytes", "either", "futures-test", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", "memchr", "pin-project-lite", @@ -7400,7 +7141,7 @@ version = "0.0.1-pre.6" dependencies = [ "either", "futures", - "http 1.1.0", + "http", "once_cell", "regex", "tower", @@ -7413,7 +7154,7 @@ name = "tower-x-clacks-overhead" version = "0.0.1-pre.6" dependencies = [ "futures-test", - "http 1.1.0", + "http", "itertools 0.12.1", "pin-project-lite", "tower", @@ -7561,7 +7302,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.1.0", + "http", "httparse", "log", "rand 0.8.5", @@ -7758,7 +7499,7 @@ version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b39868d43c011961e04b41623e050aedf2cc93652562ff7935ce0f819aaf2da" dependencies = [ - "axum 0.7.5", + "axum", "mime_guess", "regex", "rust-embed", diff --git a/Cargo.toml b/Cargo.toml index 3a25447fe..b94a401e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,7 +57,6 @@ members = [ "lib/blowocking", "lib/cursiv", "lib/geomjeungja", - "lib/http-compat", "lib/http-signatures", "lib/just-retry", "lib/masto-id-convert", diff --git a/crates/kitsune-observability/Cargo.toml b/crates/kitsune-observability/Cargo.toml index d206ffc86..d210eba83 100644 --- a/crates/kitsune-observability/Cargo.toml +++ b/crates/kitsune-observability/Cargo.toml @@ -6,27 +6,11 @@ version.workspace = true license.workspace = true [dependencies] -async-trait = "0.1.80" eyre = "0.6.12" -http-body-util = "0.1.1" -http-compat = { path = "../../lib/http-compat" } -hyper = { version = "1.3.1", default-features = false } kitsune-config = { path = "../kitsune-config" } -kitsune-http-client = { path = "../kitsune-http-client" } opentelemetry = { version = "0.22.0", default-features = false, features = [ "trace", ] } -opentelemetry-http = "0.11.1" -opentelemetry-otlp = { version = "0.15.0", default-features = false, features = [ - "grpc-tonic", - "http-proto", - "tls", - "tls-roots", - "trace", -] } -opentelemetry_sdk = { version = "0.22.1", default-features = false, features = [ - "rt-tokio", -] } tracing = "0.1.40" tracing-error = "0.2.0" tracing-opentelemetry = { version = "0.23.0", default-features = false } diff --git a/crates/kitsune-observability/src/lib.rs b/crates/kitsune-observability/src/lib.rs index b1bb2147f..b8a80fa8d 100644 --- a/crates/kitsune-observability/src/lib.rs +++ b/crates/kitsune-observability/src/lib.rs @@ -1,13 +1,7 @@ -use async_trait::async_trait; -use eyre::WrapErr; -use http_body_util::BodyExt; -use http_compat::Compat; -use kitsune_config::{open_telemetry::Transport, Configuration}; +use eyre::{bail, WrapErr}; +use kitsune_config::Configuration; use opentelemetry::trace::{noop::NoopTracer, Tracer}; -use opentelemetry_http::{Bytes, HttpClient, HttpError, Request, Response}; -use opentelemetry_otlp::{SpanExporterBuilder, WithExportConfig}; -use opentelemetry_sdk::runtime::Tokio; -use std::{env, fmt}; +use std::env; use tracing_error::ErrorLayer; use tracing_opentelemetry::{OpenTelemetryLayer, PreSampledTracer}; use tracing_subscriber::{ @@ -16,7 +10,7 @@ use tracing_subscriber::{ Layer as _, Registry, }; -#[derive(Clone)] +/*#[derive(Clone)] struct HttpClientAdapter { inner: kitsune_http_client::Client, } @@ -59,7 +53,7 @@ macro_rules! build_exporter { exporter }}; -} +}*/ fn initialise_logging(tracer: T) -> eyre::Result<()> where @@ -82,8 +76,8 @@ where } pub fn initialise(config: &Configuration) -> eyre::Result<()> { - if let Some(ref opentelemetry_config) = config.opentelemetry { - let http_client = HttpClientAdapter { + if config.opentelemetry.is_some() { + /*let http_client = HttpClientAdapter { inner: kitsune_http_client::Client::default(), }; @@ -99,7 +93,8 @@ pub fn initialise(config: &Configuration) -> eyre::Result<()> { .with_exporter(trace_exporter) .install_batch(Tokio)?; - initialise_logging(tracer)?; + initialise_logging(tracer)?;*/ + bail!("OpenTelemetry is not supported at the moment"); } else { initialise_logging(NoopTracer::new())?; } diff --git a/lib/http-compat/Cargo.toml b/lib/http-compat/Cargo.toml deleted file mode 100644 index 760c7d238..000000000 --- a/lib/http-compat/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "http-compat" -authors.workspace = true -edition.workspace = true -version.workspace = true -license = "MIT OR Apache-2.0" - -[dependencies] -http02 = { package = "http", version = "0.2.12" } -http1 = { package = "http", version = "1.1.0" } - -[lints] -workspace = true diff --git a/lib/http-compat/LICENSE-APACHE-2.0 b/lib/http-compat/LICENSE-APACHE-2.0 deleted file mode 120000 index bffaaba2f..000000000 --- a/lib/http-compat/LICENSE-APACHE-2.0 +++ /dev/null @@ -1 +0,0 @@ -../../LICENSE-APACHE-2.0 \ No newline at end of file diff --git a/lib/http-compat/LICENSE-MIT b/lib/http-compat/LICENSE-MIT deleted file mode 120000 index b2cfbdc7b..000000000 --- a/lib/http-compat/LICENSE-MIT +++ /dev/null @@ -1 +0,0 @@ -../../LICENSE-MIT \ No newline at end of file diff --git a/lib/http-compat/src/lib.rs b/lib/http-compat/src/lib.rs deleted file mode 100644 index 0df98df32..000000000 --- a/lib/http-compat/src/lib.rs +++ /dev/null @@ -1,8 +0,0 @@ -mod v0_2; -mod v1; - -pub trait Compat { - type Output; - - fn compat(self) -> Self::Output; -} diff --git a/lib/http-compat/src/v0_2.rs b/lib/http-compat/src/v0_2.rs deleted file mode 100644 index 2656d59c2..000000000 --- a/lib/http-compat/src/v0_2.rs +++ /dev/null @@ -1,74 +0,0 @@ -use crate::Compat; -use std::str::FromStr; - -impl Compat for http02::HeaderName { - type Output = http1::HeaderName; - - fn compat(self) -> Self::Output { - http1::HeaderName::from_bytes(self.as_str().as_bytes()).unwrap() - } -} - -impl Compat for http02::HeaderValue { - type Output = http1::HeaderValue; - - fn compat(self) -> Self::Output { - http1::HeaderValue::from_bytes(self.as_bytes()).unwrap() - } -} - -impl Compat for http02::HeaderMap { - type Output = http1::HeaderMap; - - fn compat(self) -> Self::Output { - self.iter() - .map(|(name, value)| (name.clone().compat(), value.clone().compat())) - .collect() - } -} - -impl Compat for http02::Method { - type Output = http1::Method; - - fn compat(self) -> Self::Output { - http1::Method::from_bytes(self.as_str().as_bytes()).unwrap() - } -} - -impl Compat for http02::Request { - type Output = http1::Request; - - fn compat(self) -> Self::Output { - let (parts, body) = self.into_parts(); - let mut req_builder = http1::Request::builder() - .method(parts.method.compat()) - .uri(parts.uri.compat()) - .version(parts.version.compat()); - *req_builder.headers_mut().unwrap() = parts.headers.compat(); - - req_builder.body(body).unwrap() - } -} - -impl Compat for http02::Uri { - type Output = http1::Uri; - - fn compat(self) -> Self::Output { - http1::Uri::from_str(&self.to_string()).unwrap() - } -} - -impl Compat for http02::Version { - type Output = http1::Version; - - fn compat(self) -> Self::Output { - match self { - http02::Version::HTTP_09 => http1::Version::HTTP_09, - http02::Version::HTTP_10 => http1::Version::HTTP_10, - http02::Version::HTTP_11 => http1::Version::HTTP_11, - http02::Version::HTTP_2 => http1::Version::HTTP_2, - http02::Version::HTTP_3 => http1::Version::HTTP_3, - _ => unreachable!(), - } - } -} diff --git a/lib/http-compat/src/v1.rs b/lib/http-compat/src/v1.rs deleted file mode 100644 index 59734ecba..000000000 --- a/lib/http-compat/src/v1.rs +++ /dev/null @@ -1,64 +0,0 @@ -use crate::Compat; - -impl Compat for http1::HeaderName { - type Output = http02::HeaderName; - - fn compat(self) -> Self::Output { - http02::HeaderName::from_bytes(self.as_str().as_bytes()).unwrap() - } -} - -impl Compat for http1::HeaderValue { - type Output = http02::HeaderValue; - - fn compat(self) -> Self::Output { - http02::HeaderValue::from_bytes(self.as_bytes()).unwrap() - } -} - -impl Compat for http1::HeaderMap { - type Output = http02::HeaderMap; - - fn compat(self) -> Self::Output { - self.iter() - .map(|(name, value)| (name.clone().compat(), value.clone().compat())) - .collect() - } -} - -impl Compat for http1::Response { - type Output = http02::Response; - - fn compat(self) -> Self::Output { - let (parts, body) = self.into_parts(); - let mut res_builder = http02::Response::builder() - .status(parts.status.compat()) - .version(parts.version.compat()); - *res_builder.headers_mut().unwrap() = parts.headers.compat(); - - res_builder.body(body).unwrap() - } -} - -impl Compat for http1::StatusCode { - type Output = http02::StatusCode; - - fn compat(self) -> Self::Output { - http02::StatusCode::from_u16(self.as_u16()).unwrap() - } -} - -impl Compat for http1::Version { - type Output = http02::Version; - - fn compat(self) -> Self::Output { - match self { - http1::Version::HTTP_09 => http02::Version::HTTP_09, - http1::Version::HTTP_10 => http02::Version::HTTP_10, - http1::Version::HTTP_11 => http02::Version::HTTP_11, - http1::Version::HTTP_2 => http02::Version::HTTP_2, - http1::Version::HTTP_3 => http02::Version::HTTP_3, - _ => unreachable!(), - } - } -}