From: MatthieuCoder Date: Sun, 8 Jan 2023 17:56:15 +0000 (+0400) Subject: merge conflicts X-Git-Tag: v0.1.1~42 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c925e01d4a96d88d9cbbe4f3d55aceaf5bff017f;p=matthieu%2Fnova.git merge conflicts --- c925e01d4a96d88d9cbbe4f3d55aceaf5bff017f diff --cc Cargo.lock index 395d77b,3d47207..8962206 --- a/Cargo.lock +++ b/Cargo.lock @@@ -1050,36 -968,19 +954,6 @@@ dependencies = "tokio-io-timeout", ] - [[package]] - name = "iana-time-zone" - version = "0.1.53" - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" - dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "winapi", - ] - --[[package]] - name = "iana-time-zone-haiku" - version = "0.1.1" -name = "hyper-tls" -version = "0.5.0" --source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" --dependencies = [ - "cxx", - "cxx-build", - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", --] - - [[package]] - name = "ident_case" - version = "1.0.1" - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -- [[package]] name = "idna" version = "0.3.0" @@@ -1376,6 -1333,111 +1262,98 @@@ version = "0.1.5 source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] - + [[package]] + name = "opentelemetry" + version = "0.18.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "69d6c3d7288a106c0a363e4b0e8d308058d56902adefb16f4936f417ffef086e" + dependencies = [ + "opentelemetry_api", + "opentelemetry_sdk", + ] + + [[package]] + name = "opentelemetry-http" + version = "0.7.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "1edc79add46364183ece1a4542592ca593e6421c60807232f5b8f7a31703825d" + dependencies = [ + "async-trait", + "bytes", + "http", + "opentelemetry_api", + ] + + [[package]] + name = "opentelemetry-otlp" + version = "0.11.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "d1c928609d087790fc936a1067bdc310ae702bdf3b090c3f281b713622c8bbde" + dependencies = [ + "async-trait", + "futures", + "futures-util", + "http", + "opentelemetry", + "opentelemetry-proto", + "prost", + "thiserror", + "tokio", + "tonic", + ] + + [[package]] + name = "opentelemetry-proto" + version = "0.1.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "d61a2f56df5574508dd86aaca016c917489e589ece4141df1b5e349af8d66c28" + dependencies = [ + "futures", + "futures-util", + "opentelemetry", + "prost", + "tonic", + "tonic-build", + ] + + [[package]] + name = "opentelemetry_api" + version = "0.18.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "c24f96e21e7acc813c7a8394ee94978929db2bcc46cf6b5014fc612bf7760c22" + dependencies = [ + "fnv", + "futures-channel", + "futures-util", + "indexmap", + "js-sys", + "once_cell", + "pin-project-lite", + "thiserror", + ] + + [[package]] + name = "opentelemetry_sdk" + version = "0.18.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "1ca41c4933371b61c2a2f214bf16931499af4ec90543604ec828f7a625c09113" + dependencies = [ + "async-trait", + "crossbeam-channel", + "dashmap", + "fnv", + "futures-channel", + "futures-executor", + "futures-util", + "once_cell", + "opentelemetry_api", + "percent-encoding", + "rand 0.8.5", + "thiserror", + "tokio", + "tokio-stream", + ] + [[package]] name = "ordered-float" version = "2.10.0" @@@ -1859,20 -1891,19 +1808,21 @@@ dependencies = "hashring", "http", "hyper", - "hyper-tls", + "hyper-rustls", + "lazy_static", "leash", + "opentelemetry", + "opentelemetry-http", "proto", "serde", - "serde_json", "shared", "tokio", - "tokio-scoped", "tokio-stream", "tonic", "tracing", + "tracing-opentelemetry", "twilight-http-ratelimiting 0.14.0 (git+https://github.com/MatthieuCoder/twilight.git)", + "xxhash-rust", ] [[package]] diff --cc exes/all/Cargo.toml index 70f31c1,26e8d04..ef23e6b --- a/exes/all/Cargo.toml +++ b/exes/all/Cargo.toml @@@ -16,7 -16,7 +16,7 @@@ ratelimit = { path = "../ratelimit" rest = { path = "../rest" } webhook = { path = "../webhook" } - tokio = { version = "1.23.1", features = ["full"] } -tokio = { version = "1.23.0", features = ["rt"] } ++tokio = { version = "1.23.1", features = ["rt"] } serde = "1.0.152" serde_json = "1.0.91" anyhow = "1.0.68" diff --cc exes/rest/Cargo.toml index f28018e,39e9798..5583416 --- a/exes/rest/Cargo.toml +++ b/exes/rest/Cargo.toml @@@ -10,20 -10,23 +10,23 @@@ shared = { path = "../../libs/shared" proto = { path = "../../libs/proto" } leash = { path = "../../libs/leash" } - hyper = { version = "0.14", features = ["full"] } - tokio = { version = "1", features = ["full"] } + hyper= "0.14" + http = "0.2.8" + + tokio = { version = "1", features = ["rt"] } serde = { version = "1.0.8", features = ["derive"] } - -hyper-tls = "0.5.0" - -# todo(MatthieuCoder): Move to the real twilight when patch is merged +futures-util = "0.3.17" +hyper-rustls = "0.23.2" +lazy_static = "1.4.0" +xxhash-rust = { version = "0.8.2", features = ["xxh32"] } twilight-http-ratelimiting = { git = "https://github.com/MatthieuCoder/twilight.git" } + tracing = "0.1.37" + anyhow = "1.0.68" hashring = "0.3.0" - anyhow = "*" tonic = "0.8.3" - serde_json = { version = "1.0" } - http = "0.2.8" tokio-stream = "0.1.11" dns-lookup = "1.0.8" - tokio-scoped = "0.2.0" + opentelemetry = "0.18.0" + opentelemetry-http = "0.7.0" + tracing-opentelemetry = "0.18.0" diff --cc exes/rest/src/handler.rs index 8b9463f,3ad4cea..6d58dce --- a/exes/rest/src/handler.rs +++ b/exes/rest/src/handler.rs @@@ -12,8 -4,14 +4,14 @@@ use http:: HeaderValue, Method as HttpMethod, Request, Response, Uri, }; use hyper::{client::HttpConnector, Body, Client}; -use hyper_tls::HttpsConnector; +use hyper_rustls::HttpsConnector; - use shared::log::error; + use std::{ + collections::hash_map::DefaultHasher, + convert::TryFrom, + hash::{Hash, Hasher}, + str::FromStr, + }; + use tracing::{debug_span, error, instrument, Instrument}; use twilight_http_ratelimiting::{Method, Path}; use crate::ratelimit_client::RemoteRatelimiter; diff --cc exes/rest/src/lib.rs index 02196f4,158fc97..0910d5e --- a/exes/rest/src/lib.rs +++ b/exes/rest/src/lib.rs @@@ -6,7 -6,10 +6,9 @@@ use hyper:: service::{make_service_fn, service_fn}, Body, Client, Request, Server, }; -use hyper_tls::HttpsConnector; use leash::{AnyhowResultFuture, Component}; + use opentelemetry::{global, trace::{Tracer}}; + use opentelemetry_http::HeaderExtractor; use shared::config::Settings; use std::{convert::Infallible, sync::Arc}; use tokio::sync::oneshot; diff --cc libs/leash/Cargo.toml index 77dd46c,364bc3a..ca110d0 --- a/libs/leash/Cargo.toml +++ b/libs/leash/Cargo.toml @@@ -8,6 -8,12 +8,12 @@@ edition = "2021 [dependencies] shared = { path = "../shared" } anyhow = "1.0.68" - tokio = { version = "1.23.1", features = ["full"] } - pretty_env_logger = "0.4" - serde = "1.0.152" -tokio = { version = "1.23.0", features = ["rt", "signal"] } ++tokio = { version = "1.23.1", features = ["rt", "signal"] } + serde = "1.0.152" + tracing-log = { version = "0.1.3", features = ["env_logger"] } + tracing-subscriber = { version = "0.3.16", features = ["env-filter"] } + tracing = "0.1.37" + env_logger = "0.10.0" + tracing-opentelemetry = "0.18.0" + opentelemetry = { version ="0.18.0", features = ["rt-tokio"] } -opentelemetry-otlp = { version = "0.11.0" } ++opentelemetry-otlp = { version = "0.11.0" } diff --cc nats.config index 0000000,0000000..9a228af new file mode 100644 --- /dev/null +++ b/nats.config @@@ -1,0 -1,0 +1,2 @@@ ++max_payload: 100000000 ++max_pending: 1000000000