Skip to content

Commit a92cfc0

Browse files
authored
linera_base::tracing: move into linera-service and linera-web respectively (#4898)
## Motivation Currently we have one `tracing` entrypoint in `linera-base` to be split between our various tracing implementations. This entrypoint has a different implementation for each of our three supported platforms (`unix`, `web`, and Linera), which makes the conditional compilation quite complicated. ## Proposal Instead, move the two present implementations onto target-specific codepaths (native to `linera-service`, which currently functions as a catch-all crate for all our Linera UNIX binaries, and Web to `linera-web`). `linera-summary` now doesn't use this, but doesn't really need to (it's a CI tool). It would be nice in the future to split out CLI utilities like input/output formats from `linera-service` into a crate that can be reüsed, and split `linera-service` into different crates that depend on that. ## Test Plan CI. The existing test has been ported to the new structure. ## Release Plan - Nothing to do / These changes follow the usual release cycle. ## Links - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent c512e52 commit a92cfc0

23 files changed

Lines changed: 137 additions & 434 deletions

File tree

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
- uses: actions-rust-lang/setup-rust-toolchain@v1
9595
- name: Run metrics tests
9696
run: |
97-
cargo test --locked -p linera-base --features metrics,opentelemetry
97+
cargo test --locked -p linera-base --features metrics
9898
9999
wasm-application-test:
100100
needs: changed-files

Cargo.lock

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ARG binaries=
2525
ARG copy=${binaries:+_copy}
2626
ARG build_flag=--release
2727
ARG build_folder=release
28-
ARG build_features=scylladb,metrics,memory-profiling,opentelemetry
28+
ARG build_features=scylladb,metrics,memory-profiling
2929
ARG rustflags="-C force-frame-pointers=yes"
3030

3131
FROM rust:1.74-slim-bookworm AS builder

examples/Cargo.lock

Lines changed: 2 additions & 140 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

linera-base/Cargo.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ workspace = true
1818
metrics = ["prometheus"]
1919
reqwest = ["dep:reqwest"]
2020
revm = []
21-
opentelemetry = ["opentelemetry-otlp"]
2221
test = ["test-strategy", "proptest"]
2322
web = [
2423
"getrandom/js",
@@ -50,7 +49,6 @@ ed25519-dalek.workspace = true
5049
futures.workspace = true
5150
getrandom = { workspace = true, optional = true }
5251
hex.workspace = true
53-
is-terminal.workspace = true
5452
k256.workspace = true
5553
linera-kywasmtime = { workspace = true, optional = true }
5654
linera-witty = { workspace = true, features = ["macros"] }
@@ -68,7 +66,6 @@ thiserror.workspace = true
6866
tokio = { workspace = true, features = ["time"] }
6967
tokio-stream.workspace = true
7068
tracing.workspace = true
71-
tracing-subscriber = { workspace = true, features = ["json", "fmt", "ansi"] }
7269
trait-variant.workspace = true
7370
wasm-bindgen = { workspace = true, optional = true }
7471
wasm-bindgen-futures = { workspace = true, optional = true }
@@ -82,11 +79,6 @@ tracing-web = { optional = true, workspace = true }
8279

8380
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
8481
chrono.workspace = true
85-
opentelemetry.workspace = true
86-
opentelemetry-otlp = { workspace = true, optional = true }
87-
opentelemetry_sdk = { workspace = true, features = ["testing"] }
88-
tracing-chrome.workspace = true
89-
tracing-opentelemetry.workspace = true
9082
rand = { workspace = true, features = ["getrandom", "std", "std_rng"] }
9183
tokio = { workspace = true, features = [
9284
"process",

linera-base/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ pub mod vm;
3838
#[cfg(not(chain))]
3939
pub use task::Blocking;
4040
pub mod time;
41-
#[cfg_attr(web, path = "tracing_web.rs")]
42-
pub mod tracing;
43-
#[cfg(not(target_arch = "wasm32"))]
44-
pub mod tracing_opentelemetry;
4541
#[cfg(test)]
4642
mod unit_tests;
4743

0 commit comments

Comments
 (0)