Skip to content

Commit

Permalink
tracing across js rust boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwhit committed Jan 27, 2025
1 parent 88490d0 commit 62347e3
Show file tree
Hide file tree
Showing 15 changed files with 621 additions and 129 deletions.
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 @@ -231,7 +231,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 @@ -618,6 +618,9 @@ pub struct WorkspaceSettings {

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

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

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

0 comments on commit 62347e3

Please sign in to comment.