Skip to content

Commit

Permalink
feat: use feature flag telemetry opt-in for release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
waynr committed Jan 17, 2025
1 parent 8e8d446 commit f6728fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ jobs:
command: rustup target add << parameters.target >>
- run:
name: Cargo release build
command: target-env cargo build --target=<< parameters.target >> --profile=<< parameters.profile >> --workspace
command: target-env cargo build --features "influxdb3/release_default" --target=<< parameters.target >> --profile=<< parameters.profile >> --workspace
# linking might take a while and doesn't produce CLI output
no_output_timeout: 30m
- run:
Expand Down
2 changes: 2 additions & 0 deletions influxdb3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ console-subscriber = { version = "0.1.10", optional = true, features = ["parking

[features]
default = ["jemalloc_replacing_malloc", "azure", "gcp", "aws"]
release_default = ["default", "enable_telemetry"]
enable_telemetry = []

azure = ["influxdb3_clap_blocks/azure"] # Optional Azure Object store support
gcp = ["influxdb3_clap_blocks/gcp"] # Optional GCP object store support
Expand Down
8 changes: 4 additions & 4 deletions influxdb3/src/commands/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,10 +627,7 @@ async fn setup_telemetry_store(
.unwrap_or(ObjectStoreType::Memory);
let storage_type = obj_store_type.as_str();

if disable_upload {
debug!("Initializing TelemetryStore with upload disabled.");
TelemetryStore::new_without_background_runners(persisted_files.map(|p| p as _))
} else {
if !disable_upload && cfg!(feature = "enable_telemetry") {
debug!("Initializing TelemetryStore with upload enabled for {telemetry_endpoint}.");
TelemetryStore::new(
instance_id,
Expand All @@ -642,6 +639,9 @@ async fn setup_telemetry_store(
telemetry_endpoint.to_string(),
)
.await
} else {
debug!("Initializing TelemetryStore with upload disabled.");
TelemetryStore::new_without_background_runners(persisted_files.map(|p| p as _))
}
}

Expand Down

0 comments on commit f6728fc

Please sign in to comment.