Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(lsp): add built-in tracing support for the LSP #27843

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 37 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ opentelemetry = "0.27.0"
opentelemetry-http = "0.27.0"
opentelemetry-otlp = { version = "0.27.0", features = ["logs", "http-proto", "http-json"] }
opentelemetry-semantic-conventions = { version = "0.27.0", features = ["semconv_experimental"] }
opentelemetry_sdk = "0.27.0"
opentelemetry_sdk = { version = "0.27.0", features = ["rt-tokio", "trace"] }

# crypto
hkdf = "0.12.3"
Expand Down
9 changes: 8 additions & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ monch.workspace = true
notify.workspace = true
once_cell.workspace = true
open = "5.0.1"
opentelemetry.workspace = true
opentelemetry-otlp.workspace = true
opentelemetry-semantic-conventions.workspace = true
opentelemetry_sdk.workspace = true
p256.workspace = true
pathdiff = "0.2.1"
percent-encoding.workspace = true
Expand All @@ -165,8 +169,11 @@ text_lines = "=0.6.0"
thiserror.workspace = true
tokio.workspace = true
tokio-util.workspace = true
tower.workspace = true
tower-lsp.workspace = true
tracing = { version = "0.1", features = ["log", "default"] }
tracing = { version = "0.1", features = ["log"] }
tracing-opentelemetry = "0.28.0"
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
twox-hash.workspace = true
typed-arena = "=2.0.2"
uuid = { workspace = true, features = ["serde"] }
Expand Down
1 change: 1 addition & 0 deletions cli/lib/util/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ pub fn init<
.filter_module("swc_ecma_parser", log::LevelFilter::Error)
// Suppress span lifecycle logs since they are too verbose
.filter_module("tracing::span", log::LevelFilter::Off)
.filter_module("tower_lsp", log::LevelFilter::Trace)
// for deno_compile, this is too verbose
.filter_module("editpe", log::LevelFilter::Error)
.format(|buf, record| {
Expand Down
1 change: 1 addition & 0 deletions cli/lsp/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ fn to_narrow_lsp_range(
/// completion response, which will be valid import completions for the specific
/// context.
#[allow(clippy::too_many_arguments)]
#[tracing::instrument(skip_all)]
pub async fn get_import_completions(
specifier: &ModuleSpecifier,
position: &lsp::Position,
Expand Down
7 changes: 6 additions & 1 deletion cli/lsp/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,9 @@ pub struct WorkspaceSettings {

#[serde(default)]
pub typescript: LanguageWorkspaceSettings,

#[serde(default)]
pub tracing: Option<super::trace::TracingConfigOrEnabled>,
}

impl Default for WorkspaceSettings {
Expand All @@ -645,6 +648,7 @@ impl Default for WorkspaceSettings {
unstable: Default::default(),
javascript: Default::default(),
typescript: Default::default(),
tracing: Default::default(),
}
}
}
Expand Down Expand Up @@ -2286,8 +2290,9 @@ mod tests {
suggestion_actions: SuggestionActionsSettings { enabled: true },
update_imports_on_file_move: UpdateImportsOnFileMoveOptions {
enabled: UpdateImportsOnFileMoveEnabled::Prompt
}
},
},
tracing: Default::default()
}
);
}
Expand Down
Loading
Loading