]> git.puffer.fish Git - matthieu/nova.git/commitdiff
merge conflicts
authorMatthieuCoder <matthieu@matthieu-dev.xyz>
Sun, 8 Jan 2023 17:56:15 +0000 (21:56 +0400)
committerMatthieuCoder <matthieu@matthieu-dev.xyz>
Sun, 8 Jan 2023 17:56:15 +0000 (21:56 +0400)
1  2 
Cargo.lock
exes/all/Cargo.toml
exes/rest/Cargo.toml
exes/rest/src/handler.rs
exes/rest/src/lib.rs
libs/leash/Cargo.toml
nats.config

diff --cc Cargo.lock
index 395d77b7e37bfa1f0b81cc8aa88b031fdf3544be,3d47207552b652ea3b758faf564bfdd0dcbe481d..8962206fcd1113b9dcaa6f062061aae8b62d5a9b
@@@ -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]]
index 70f31c17af8519e05344cd0ced0b3fc0a926ab3f,26e8d044ccfcbcd230b5fa3b76b923c09541299d..ef23e6bed075d140db402a572b069efbc3d97437
@@@ -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"
index f28018eb9e8247d67a2c6d3f3add7b63540b668e,39e9798997299b91e9eb71b94b2bdc1ca5f594f2..55834166bf4e8ebd71b5ed4c222a928f40375608
@@@ -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"
index 8b9463f6f269dfa67b17edcbadf742a61a52d162,3ad4cea2328e2f929cc889e4f183c6b69534bf25..6d58dce94f3a2d91ab073d931b2ce52be9add306
@@@ -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;
index 02196f4acf058ebe052249e08069340b3c654c9c,158fc97609eed15901baec52f2ad75851bb11c56..0910d5e3147cda2ae81088071092842b4c812a40
@@@ -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;
index 77dd46ce44641ccfdbfe4a07ea27b4cd8b0b306c,364bc3a5876a452dd227fce36531240cfe010255..ca110d0555cac1206f83d04f93c3fd87f3de09a5
@@@ -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 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..9a228af1c9b5acbe507fd4259f1f9ea16ad00ac4
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,2 @@@
++max_payload: 100000000
++max_pending: 1000000000