Skip to content

Commit cd333ab

Browse files
committed
Rename telemetry exporters crate
1 parent 0101dba commit cd333ab

19 files changed

Lines changed: 623 additions & 585 deletions

File tree

quickwit/Cargo.lock

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

quickwit/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ members = [
2727
"quickwit-macros",
2828
"quickwit-metastore",
2929
"quickwit-metrics",
30-
"quickwit-metrics-exporters",
30+
"quickwit-telemetry-exporters",
3131
"quickwit-metrics-inventory",
3232

3333
# Disabling metastore-utils from the quickwit projects to ease build/deps.
@@ -73,7 +73,7 @@ default-members = [
7373
"quickwit-macros",
7474
"quickwit-metastore",
7575
"quickwit-metrics",
76-
"quickwit-metrics-exporters",
76+
"quickwit-telemetry-exporters",
7777
"quickwit-metrics-inventory",
7878
"quickwit-opentelemetry",
7979
"quickwit-parquet-engine",
@@ -392,7 +392,7 @@ quickwit-lambda-server = { path = "quickwit-lambda-server" }
392392
quickwit-macros = { path = "quickwit-macros" }
393393
quickwit-metastore = { path = "quickwit-metastore" }
394394
quickwit-metrics = { path = "quickwit-metrics" }
395-
quickwit-metrics-exporters = { path = "quickwit-metrics-exporters" }
395+
quickwit-telemetry-exporters = { path = "quickwit-telemetry-exporters" }
396396
quickwit-metrics-inventory = { path = "quickwit-metrics-inventory" }
397397
quickwit-opentelemetry = { path = "quickwit-opentelemetry" }
398398
quickwit-parquet-engine = { path = "quickwit-parquet-engine" }

quickwit/quickwit-cli/Cargo.toml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,17 @@ path = "src/generate_markdown.rs"
2222

2323
[dependencies]
2424
anyhow = { workspace = true }
25-
backtrace = { workspace = true, optional = true }
2625
bytesize = { workspace = true }
2726
chrono = { workspace = true }
2827
clap = { workspace = true }
2928
colored = { workspace = true }
30-
console-subscriber = { workspace = true, optional = true }
3129
dialoguer = { workspace = true }
3230
futures = { workspace = true }
3331
humantime = { workspace = true }
3432
indicatif = { workspace = true }
3533
itertools = { workspace = true }
3634
numfmt = { workspace = true }
3735
openssl-probe = { workspace = true, optional = true }
38-
opentelemetry = { workspace = true }
39-
opentelemetry-appender-tracing = { workspace = true }
40-
opentelemetry_sdk = { workspace = true }
4136
reqwest = { workspace = true }
4237
rustls = { workspace = true }
4338
serde_json = { workspace = true }
@@ -51,8 +46,6 @@ time = { workspace = true }
5146
tokio = { workspace = true }
5247
toml = { workspace = true }
5348
tracing = { workspace = true }
54-
tracing-opentelemetry = { workspace = true }
55-
tracing-subscriber = { workspace = true }
5649

5750
quickwit-actors = { workspace = true }
5851
quickwit-cluster = { workspace = true }
@@ -63,7 +56,7 @@ quickwit-index-management = { workspace = true }
6356
quickwit-indexing = { workspace = true }
6457
quickwit-ingest = { workspace = true }
6558
quickwit-metastore = { workspace = true }
66-
quickwit-metrics-exporters = { workspace = true }
59+
quickwit-telemetry-exporters = { workspace = true }
6760
quickwit-proto = { workspace = true }
6861
quickwit-rest-client = { workspace = true }
6962
quickwit-search = { workspace = true }
@@ -86,8 +79,8 @@ quickwit-storage = { workspace = true, features = ["testsuite"] }
8679
datafusion = ["quickwit-serve/datafusion"]
8780
jemalloc = ["dep:tikv-jemalloc-ctl", "dep:tikv-jemallocator"]
8881
jemalloc-profiled = [
89-
"dep:backtrace",
9082
"quickwit-common/jemalloc-profiled",
83+
"quickwit-telemetry-exporters/jemalloc-profiled",
9184
"quickwit-serve/jemalloc-profiled"
9285
]
9386
ci-test = []
@@ -97,7 +90,10 @@ openssl-support = ["openssl-probe"]
9790
# (this is not about quickwit's metrics themselves)
9891
metrics = [ "quickwit-indexing/metrics" ]
9992
# Requires to enable tokio unstable via RUSTFLAGS="--cfg tokio_unstable"
100-
tokio-console = ["console-subscriber", "quickwit-common/named_tasks"]
93+
tokio-console = [
94+
"quickwit-common/named_tasks",
95+
"quickwit-telemetry-exporters/tokio-console",
96+
]
10197
release-feature-set = [
10298
"jemalloc",
10399
"openssl-support",

quickwit/quickwit-cli/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ pub mod cli;
4949
pub mod index;
5050
#[cfg(feature = "jemalloc")]
5151
pub mod jemalloc;
52-
pub mod logger;
5352
pub mod metrics;
5453
pub mod service;
5554
pub mod source;
@@ -60,8 +59,6 @@ pub mod tool;
6059
/// Throughput calculation window size.
6160
const THROUGHPUT_WINDOW_SIZE: usize = 5;
6261

63-
pub const QW_ENABLE_TOKIO_CONSOLE_ENV_KEY: &str = "QW_ENABLE_TOKIO_CONSOLE";
64-
6562
fn config_cli_arg() -> Arg {
6663
Arg::new("config")
6764
.long("config")

quickwit/quickwit-cli/src/main.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ use quickwit_cli::checklist::RED_COLOR;
2020
use quickwit_cli::cli::{CliCommand, build_cli};
2121
#[cfg(feature = "jemalloc")]
2222
use quickwit_cli::jemalloc::start_jemalloc_metrics_loop;
23-
use quickwit_cli::logger::{TelemetryHandle, init_telemetry};
23+
use quickwit_cli::metrics::register_build_info_metric;
2424
use quickwit_cli::{busy_detector, install_default_crypto_ring_provider};
2525
use quickwit_common::runtimes::scrape_tokio_runtime_metrics;
2626
use quickwit_serve::BuildInfo;
27+
use quickwit_telemetry_exporters::TelemetryHandle;
2728
use tracing::error;
2829

2930
/// The main tokio runtime takes num_cores / 3 threads by default, and can be overridden by the
@@ -60,7 +61,13 @@ fn main() -> anyhow::Result<()> {
6061
rt.block_on(async move {
6162
install_default_crypto_ring_provider();
6263

63-
let telemetry_handle = init_telemetry(command.default_log_level(), ansi_colors)?;
64+
let build_info = BuildInfo::get();
65+
let telemetry_handle = quickwit_telemetry_exporters::init_telemetry(
66+
&build_info.version,
67+
command.default_log_level(),
68+
ansi_colors,
69+
)?;
70+
register_build_info_metric(build_info);
6471

6572
let runtime_handle = tokio::runtime::Handle::current();
6673
scrape_tokio_runtime_metrics(&runtime_handle, "main");

quickwit/quickwit-cli/src/metrics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static BUILD_INFO: LazyLock<Counter> = LazyLock::new(|| {
2525
subsystem: "",
2626
)
2727
});
28-
pub(crate) fn register_metrics(build_info: &BuildInfo) {
28+
pub fn register_build_info_metric(build_info: &BuildInfo) {
2929
let commit_tags = build_info.commit_tags.join(",");
3030
let labels = labels!(
3131
"build_date" => build_info.build_date,

quickwit/quickwit-metrics-exporters/Cargo.toml

Lines changed: 0 additions & 26 deletions
This file was deleted.

quickwit/quickwit-metrics-exporters/src/dogstatsd.rs

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)