Fix tracing subscriber after introducing Tokio-console (#8907)
We've also upgraded `Axum` in order to avoid having two versions of that library in Collab (one due to Tokio-console). Release Notes: - N/A --------- Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
parent
703c9655a0
commit
b68a277b5e
10 changed files with 75 additions and 118 deletions
127
Cargo.lock
generated
127
Cargo.lock
generated
|
@ -1224,13 +1224,13 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "axum"
|
name = "axum"
|
||||||
version = "0.5.17"
|
version = "0.6.20"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43"
|
checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"axum-core 0.2.9",
|
"axum-core",
|
||||||
"base64 0.13.1",
|
"base64 0.21.4",
|
||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"bytes 1.5.0",
|
"bytes 1.5.0",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
|
@ -1239,68 +1239,25 @@ dependencies = [
|
||||||
"http-body",
|
"http-body",
|
||||||
"hyper",
|
"hyper",
|
||||||
"itoa",
|
"itoa",
|
||||||
"matchit 0.5.0",
|
"matchit",
|
||||||
"memchr",
|
|
||||||
"mime",
|
|
||||||
"percent-encoding",
|
|
||||||
"pin-project-lite",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"serde_urlencoded",
|
|
||||||
"sha-1 0.10.1",
|
|
||||||
"sync_wrapper",
|
|
||||||
"tokio",
|
|
||||||
"tokio-tungstenite",
|
|
||||||
"tower",
|
|
||||||
"tower-http 0.3.5",
|
|
||||||
"tower-layer",
|
|
||||||
"tower-service",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[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 1.5.0",
|
|
||||||
"futures-util",
|
|
||||||
"http 0.2.9",
|
|
||||||
"http-body",
|
|
||||||
"hyper",
|
|
||||||
"itoa",
|
|
||||||
"matchit 0.7.3",
|
|
||||||
"memchr",
|
"memchr",
|
||||||
"mime",
|
"mime",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
"serde",
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"serde_path_to_error",
|
||||||
|
"serde_urlencoded",
|
||||||
|
"sha1",
|
||||||
"sync_wrapper",
|
"sync_wrapper",
|
||||||
|
"tokio",
|
||||||
|
"tokio-tungstenite",
|
||||||
"tower",
|
"tower",
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "axum-core"
|
|
||||||
version = "0.2.9"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "37e5939e02c56fecd5c017c37df4238c0a839fa76b7f97acdd7efb804fd181cc"
|
|
||||||
dependencies = [
|
|
||||||
"async-trait",
|
|
||||||
"bytes 1.5.0",
|
|
||||||
"futures-util",
|
|
||||||
"http 0.2.9",
|
|
||||||
"http-body",
|
|
||||||
"mime",
|
|
||||||
"tower-layer",
|
|
||||||
"tower-service",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "axum-core"
|
name = "axum-core"
|
||||||
version = "0.3.4"
|
version = "0.3.4"
|
||||||
|
@ -1320,11 +1277,11 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "axum-extra"
|
name = "axum-extra"
|
||||||
version = "0.3.7"
|
version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "69034b3b0fd97923eee2ce8a47540edb21e07f48f87f67d44bb4271cec622bdb"
|
checksum = "f9a320103719de37b7b4da4c8eb629d4573f6bcfd3dfe80d3208806895ccf81d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum 0.5.17",
|
"axum",
|
||||||
"bytes 1.5.0",
|
"bytes 1.5.0",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http 0.2.9",
|
"http 0.2.9",
|
||||||
|
@ -2264,7 +2221,7 @@ dependencies = [
|
||||||
"audio",
|
"audio",
|
||||||
"aws-config",
|
"aws-config",
|
||||||
"aws-sdk-s3",
|
"aws-sdk-s3",
|
||||||
"axum 0.5.17",
|
"axum",
|
||||||
"axum-extra",
|
"axum-extra",
|
||||||
"call",
|
"call",
|
||||||
"channel",
|
"channel",
|
||||||
|
@ -2286,7 +2243,6 @@ dependencies = [
|
||||||
"git",
|
"git",
|
||||||
"gpui",
|
"gpui",
|
||||||
"hex",
|
"hex",
|
||||||
"hyper",
|
|
||||||
"indoc",
|
"indoc",
|
||||||
"language",
|
"language",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
|
@ -2326,7 +2282,6 @@ dependencies = [
|
||||||
"tower",
|
"tower",
|
||||||
"tower-http 0.4.4",
|
"tower-http 0.4.4",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-log",
|
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"unindent",
|
"unindent",
|
||||||
"util",
|
"util",
|
||||||
|
@ -3060,6 +3015,12 @@ version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f"
|
checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "data-encoding"
|
||||||
|
version = "2.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "data-url"
|
name = "data-url"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
|
@ -5805,12 +5766,6 @@ version = "0.1.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
|
checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "matchit"
|
|
||||||
version = "0.5.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "matchit"
|
name = "matchit"
|
||||||
version = "0.7.3"
|
version = "0.7.3"
|
||||||
|
@ -8853,6 +8808,16 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_path_to_error"
|
||||||
|
version = "0.1.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c"
|
||||||
|
dependencies = [
|
||||||
|
"itoa",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_repr"
|
name = "serde_repr"
|
||||||
version = "0.1.16"
|
version = "0.1.16"
|
||||||
|
@ -8924,17 +8889,6 @@ dependencies = [
|
||||||
"opaque-debug",
|
"opaque-debug",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "sha-1"
|
|
||||||
version = "0.10.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if 1.0.0",
|
|
||||||
"cpufeatures",
|
|
||||||
"digest 0.10.7",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sha1"
|
name = "sha1"
|
||||||
version = "0.10.6"
|
version = "0.10.6"
|
||||||
|
@ -10292,14 +10246,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio-tungstenite"
|
name = "tokio-tungstenite"
|
||||||
version = "0.17.2"
|
version = "0.20.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181"
|
checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"log",
|
"log",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tungstenite 0.17.3",
|
"tungstenite 0.20.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -10390,7 +10344,7 @@ checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-stream",
|
"async-stream",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"axum 0.6.20",
|
"axum",
|
||||||
"base64 0.21.4",
|
"base64 0.21.4",
|
||||||
"bytes 1.5.0",
|
"bytes 1.5.0",
|
||||||
"h2",
|
"h2",
|
||||||
|
@ -10443,7 +10397,6 @@ dependencies = [
|
||||||
"http-body",
|
"http-body",
|
||||||
"http-range-header",
|
"http-range-header",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"tower",
|
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
]
|
]
|
||||||
|
@ -11044,7 +10997,7 @@ dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"native-tls",
|
"native-tls",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"sha-1 0.9.8",
|
"sha-1",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"url",
|
"url",
|
||||||
"utf-8",
|
"utf-8",
|
||||||
|
@ -11052,18 +11005,18 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tungstenite"
|
name = "tungstenite"
|
||||||
version = "0.17.3"
|
version = "0.20.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0"
|
checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.13.1",
|
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"bytes 1.5.0",
|
"bytes 1.5.0",
|
||||||
|
"data-encoding",
|
||||||
"http 0.2.9",
|
"http 0.2.9",
|
||||||
"httparse",
|
"httparse",
|
||||||
"log",
|
"log",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"sha-1 0.10.1",
|
"sha1",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"url",
|
"url",
|
||||||
"utf-8",
|
"utf-8",
|
||||||
|
|
|
@ -22,8 +22,8 @@ anyhow.workspace = true
|
||||||
async-tungstenite = "0.16"
|
async-tungstenite = "0.16"
|
||||||
aws-config = { version = "1.1.5" }
|
aws-config = { version = "1.1.5" }
|
||||||
aws-sdk-s3 = { version = "1.15.0" }
|
aws-sdk-s3 = { version = "1.15.0" }
|
||||||
axum = { version = "0.5", features = ["json", "headers", "ws"] }
|
axum = { version = "0.6", features = ["json", "headers", "ws"] }
|
||||||
axum-extra = { version = "0.3", features = ["erased-json"] }
|
axum-extra = { version = "0.4", features = ["erased-json"] }
|
||||||
chrono.workspace = true
|
chrono.workspace = true
|
||||||
clock.workspace = true
|
clock.workspace = true
|
||||||
clickhouse.workspace = true
|
clickhouse.workspace = true
|
||||||
|
@ -32,7 +32,6 @@ dashmap = "5.4"
|
||||||
envy = "0.4.2"
|
envy = "0.4.2"
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
hex.workspace = true
|
hex.workspace = true
|
||||||
hyper = "0.14"
|
|
||||||
live_kit_server.workspace = true
|
live_kit_server.workspace = true
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
nanoid = "0.4"
|
nanoid = "0.4"
|
||||||
|
@ -59,8 +58,7 @@ toml.workspace = true
|
||||||
tower = "0.4"
|
tower = "0.4"
|
||||||
tower-http = { workspace = true, features = ["trace"] }
|
tower-http = { workspace = true, features = ["trace"] }
|
||||||
tracing = "0.1.34"
|
tracing = "0.1.34"
|
||||||
tracing-log = "0.1.3"
|
tracing-subscriber = { version = "0.3.11", features = ["env-filter", "json", "registry", "tracing-log"] }
|
||||||
tracing-subscriber = { version = "0.3.11", features = ["env-filter", "json"] }
|
|
||||||
util.workspace = true
|
util.workspace = true
|
||||||
uuid.workspace = true
|
uuid.workspace = true
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,8 @@ spec:
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
- containerPort: 6669
|
||||||
|
protocol: TCP
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
|
|
|
@ -11,7 +11,7 @@ use crate::{
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use axum::{
|
use axum::{
|
||||||
body::Body,
|
body::Body,
|
||||||
extract::{Path, Query},
|
extract::{self, Path, Query},
|
||||||
http::{self, Request, StatusCode},
|
http::{self, Request, StatusCode},
|
||||||
middleware::{self, Next},
|
middleware::{self, Next},
|
||||||
response::IntoResponse,
|
response::IntoResponse,
|
||||||
|
@ -26,7 +26,7 @@ use tower::ServiceBuilder;
|
||||||
|
|
||||||
pub use extensions::fetch_extensions_from_blob_store_periodically;
|
pub use extensions::fetch_extensions_from_blob_store_periodically;
|
||||||
|
|
||||||
pub fn routes(rpc_server: Option<Arc<rpc::Server>>, state: Arc<AppState>) -> Router<Body> {
|
pub fn routes(rpc_server: Option<Arc<rpc::Server>>, state: Arc<AppState>) -> Router<(), Body> {
|
||||||
Router::new()
|
Router::new()
|
||||||
.route("/user", get(get_authenticated_user))
|
.route("/user", get(get_authenticated_user))
|
||||||
.route("/users/:id/access_tokens", post(create_access_token))
|
.route("/users/:id/access_tokens", post(create_access_token))
|
||||||
|
@ -176,8 +176,8 @@ async fn check_is_contributor(
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn add_contributor(
|
async fn add_contributor(
|
||||||
Json(params): Json<AuthenticatedUserParams>,
|
|
||||||
Extension(app): Extension<Arc<AppState>>,
|
Extension(app): Extension<Arc<AppState>>,
|
||||||
|
extract::Json(params): extract::Json<AuthenticatedUserParams>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
app.db
|
app.db
|
||||||
.add_contributor(
|
.add_contributor(
|
||||||
|
|
|
@ -3,9 +3,12 @@ use std::sync::{Arc, OnceLock};
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{anyhow, Context};
|
||||||
use aws_sdk_s3::primitives::ByteStream;
|
use aws_sdk_s3::primitives::ByteStream;
|
||||||
use axum::{
|
use axum::{
|
||||||
body::Bytes, headers::Header, http::HeaderName, routing::post, Extension, Router, TypedHeader,
|
body::Bytes,
|
||||||
|
headers::Header,
|
||||||
|
http::{HeaderMap, HeaderName, StatusCode},
|
||||||
|
routing::post,
|
||||||
|
Extension, Router, TypedHeader,
|
||||||
};
|
};
|
||||||
use hyper::{HeaderMap, StatusCode};
|
|
||||||
use serde::{Serialize, Serializer};
|
use serde::{Serialize, Serializer};
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
use telemetry_events::{
|
use telemetry_events::{
|
||||||
|
@ -81,8 +84,8 @@ impl Header for CloudflareIpCountryHeader {
|
||||||
|
|
||||||
pub async fn post_crash(
|
pub async fn post_crash(
|
||||||
Extension(app): Extension<Arc<AppState>>,
|
Extension(app): Extension<Arc<AppState>>,
|
||||||
body: Bytes,
|
|
||||||
headers: HeaderMap,
|
headers: HeaderMap,
|
||||||
|
body: Bytes,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
static CRASH_REPORTS_BUCKET: &str = "zed-crash-reports";
|
static CRASH_REPORTS_BUCKET: &str = "zed-crash-reports";
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,12 @@ use anyhow::{anyhow, Context as _};
|
||||||
use aws_sdk_s3::presigning::PresigningConfig;
|
use aws_sdk_s3::presigning::PresigningConfig;
|
||||||
use axum::{
|
use axum::{
|
||||||
extract::{Path, Query},
|
extract::{Path, Query},
|
||||||
|
http::StatusCode,
|
||||||
response::Redirect,
|
response::Redirect,
|
||||||
routing::get,
|
routing::get,
|
||||||
Extension, Json, Router,
|
Extension, Json, Router,
|
||||||
};
|
};
|
||||||
use collections::HashMap;
|
use collections::HashMap;
|
||||||
use hyper::StatusCode;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{sync::Arc, time::Duration};
|
use std::{sync::Arc, time::Duration};
|
||||||
use time::PrimitiveDateTime;
|
use time::PrimitiveDateTime;
|
||||||
|
|
|
@ -43,8 +43,8 @@ impl From<axum::Error> for Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<hyper::Error> for Error {
|
impl From<axum::http::Error> for Error {
|
||||||
fn from(error: hyper::Error) -> Self {
|
fn from(error: axum::http::Error) -> Self {
|
||||||
Self::Internal(error.into())
|
Self::Internal(error.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use axum::{extract::MatchedPath, routing::get, Extension, Router};
|
use axum::{extract::MatchedPath, http::Request, routing::get, Extension, Router};
|
||||||
use collab::{
|
use collab::{
|
||||||
api::fetch_extensions_from_blob_store_periodically, db, env, executor::Executor, AppState,
|
api::fetch_extensions_from_blob_store_periodically, db, env, executor::Executor, AppState,
|
||||||
Config, MigrateConfig, Result,
|
Config, MigrateConfig, Result,
|
||||||
};
|
};
|
||||||
use db::Database;
|
use db::Database;
|
||||||
use hyper::Request;
|
|
||||||
use std::{
|
use std::{
|
||||||
env::args,
|
env::args,
|
||||||
net::{SocketAddr, TcpListener},
|
net::{SocketAddr, TcpListener},
|
||||||
|
@ -16,8 +15,9 @@ use std::{
|
||||||
use tokio::signal::unix::SignalKind;
|
use tokio::signal::unix::SignalKind;
|
||||||
use tower_http::trace::{self, TraceLayer};
|
use tower_http::trace::{self, TraceLayer};
|
||||||
use tracing::Level;
|
use tracing::Level;
|
||||||
use tracing_log::LogTracer;
|
use tracing_subscriber::{
|
||||||
use tracing_subscriber::{filter::EnvFilter, fmt::format::JsonFields, Layer};
|
filter::EnvFilter, fmt::format::JsonFields, util::SubscriberInitExt, Layer,
|
||||||
|
};
|
||||||
use util::ResultExt;
|
use util::ResultExt;
|
||||||
|
|
||||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
|
@ -25,7 +25,6 @@ const REVISION: Option<&'static str> = option_env!("GITHUB_SHA");
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
console_subscriber::init();
|
|
||||||
if let Err(error) = env::load_dotenv() {
|
if let Err(error) = env::load_dotenv() {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"error loading .env.toml (this is expected in production): {}",
|
"error loading .env.toml (this is expected in production): {}",
|
||||||
|
@ -112,7 +111,8 @@ async fn main() -> Result<()> {
|
||||||
);
|
);
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
axum::Server::from_tcp(listener)?
|
axum::Server::from_tcp(listener)
|
||||||
|
.map_err(|e| anyhow!(e))?
|
||||||
.serve(app.into_make_service_with_connect_info::<SocketAddr>())
|
.serve(app.into_make_service_with_connect_info::<SocketAddr>())
|
||||||
.with_graceful_shutdown(async move {
|
.with_graceful_shutdown(async move {
|
||||||
let mut sigterm = tokio::signal::unix::signal(SignalKind::terminate())
|
let mut sigterm = tokio::signal::unix::signal(SignalKind::terminate())
|
||||||
|
@ -129,7 +129,8 @@ async fn main() -> Result<()> {
|
||||||
rpc_server.teardown();
|
rpc_server.teardown();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.await?;
|
.await
|
||||||
|
.map_err(|e| anyhow!(e))?;
|
||||||
|
|
||||||
// todo("windows")
|
// todo("windows")
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
@ -179,11 +180,11 @@ async fn handle_liveness_probe(Extension(state): Extension<Arc<AppState>>) -> Re
|
||||||
pub fn init_tracing(config: &Config) -> Option<()> {
|
pub fn init_tracing(config: &Config) -> Option<()> {
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use tracing_subscriber::layer::SubscriberExt;
|
use tracing_subscriber::layer::SubscriberExt;
|
||||||
let rust_log = config.rust_log.clone()?;
|
|
||||||
|
|
||||||
LogTracer::init().log_err()?;
|
let filter = EnvFilter::from_str(config.rust_log.as_deref()?).log_err()?;
|
||||||
|
|
||||||
let subscriber = tracing_subscriber::Registry::default()
|
tracing_subscriber::registry()
|
||||||
|
.with(console_subscriber::spawn())
|
||||||
.with(if config.log_json.unwrap_or(false) {
|
.with(if config.log_json.unwrap_or(false) {
|
||||||
Box::new(
|
Box::new(
|
||||||
tracing_subscriber::fmt::layer()
|
tracing_subscriber::fmt::layer()
|
||||||
|
@ -193,17 +194,17 @@ pub fn init_tracing(config: &Config) -> Option<()> {
|
||||||
.json()
|
.json()
|
||||||
.flatten_event(true)
|
.flatten_event(true)
|
||||||
.with_span_list(true),
|
.with_span_list(true),
|
||||||
),
|
)
|
||||||
|
.with_filter(filter),
|
||||||
) as Box<dyn Layer<_> + Send + Sync>
|
) as Box<dyn Layer<_> + Send + Sync>
|
||||||
} else {
|
} else {
|
||||||
Box::new(
|
Box::new(
|
||||||
tracing_subscriber::fmt::layer()
|
tracing_subscriber::fmt::layer()
|
||||||
.event_format(tracing_subscriber::fmt::format().pretty()),
|
.event_format(tracing_subscriber::fmt::format().pretty())
|
||||||
|
.with_filter(filter),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.with(EnvFilter::from_str(rust_log.as_str()).log_err()?);
|
.init();
|
||||||
|
|
||||||
tracing::subscriber::set_global_default(subscriber).unwrap();
|
|
||||||
|
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
@ -844,7 +844,7 @@ impl Header for AppVersionHeader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn routes(server: Arc<Server>) -> Router<Body> {
|
pub fn routes(server: Arc<Server>) -> Router<(), Body> {
|
||||||
Router::new()
|
Router::new()
|
||||||
.route("/rpc", get(handle_websocket_request))
|
.route("/rpc", get(handle_websocket_request))
|
||||||
.layer(
|
.layer(
|
||||||
|
|
|
@ -6,4 +6,4 @@ mkdir -p .blob_store/zed-crash-reports
|
||||||
|
|
||||||
export MINIO_ROOT_USER=the-blob-store-access-key
|
export MINIO_ROOT_USER=the-blob-store-access-key
|
||||||
export MINIO_ROOT_PASSWORD=the-blob-store-secret-key
|
export MINIO_ROOT_PASSWORD=the-blob-store-secret-key
|
||||||
minio server --quiet .blob_store
|
exec minio server --quiet .blob_store
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue