Skip to content

Commit ad4e3ee

Browse files
nipunn1313STAR-173
authored andcommitted
convex-backend PR 196: Fix: Respect DISABLE_BEACON env var in backend (#40167)
This change addresses issue #194 by making the backend binary directly obey the DISABLE_BEACON environment variable, in addition to the existing --disable-beacon flag. Previously, the environment variable was only handled by the Docker Compose setup, which was confusing for users not using Docker. This PR also clarifies the startup message to reflect that either the environment variable or the command-line flag can be used to disable telemetry. ---- By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. Co-authored-by: Shoaib <[email protected]> GitOrigin-RevId: 16af2efdb891547324020847e5359bfa53d46911
1 parent b62d4f1 commit ad4e3ee

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

crates/local_backend/src/beacon.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ pub async fn start_beacon(
9595
tracing::info!(
9696
"Beacon request with json {sent_json} sent successfully to {url}. This \
9797
anonymized data is used to help Convex understand and improve the product. \
98-
You can disable this telemetry by setting the --disable-beacon flag."
98+
You can disable this telemetry by setting the --disable-beacon flag or the \
99+
DISABLE_BEACON environment variable."
99100
);
100101
} else {
101102
tracing::warn!("Beacon request failed with status: {}", response.status());

crates/local_backend/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub struct LocalConfig {
103103
/// self-hosted Convex will periodically communicate with a remote beacon
104104
/// server. This is to help Convex understand and improve the product.
105105
/// If set, the self-host beacon will not be sent.
106-
#[clap(long)]
106+
#[clap(long, env = "DISABLE_BEACON", value_parser = clap::builder::BoolishValueParser::new())]
107107
pub disable_beacon: bool,
108108

109109
/// A tag to identify the self-hosted instance.

crates/local_backend/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn main() -> Result<(), MainError> {
4747
"The self-host Convex backend will periodically communicate with a remote beacon \
4848
server. This is to help Convex understand and improve the product. You can disable \
4949
this telemetry by setting the --disable-beacon flag or the DISABLE_BEACON \
50-
environment variable if you are self-hosting using the Docker image."
50+
environment variable."
5151
);
5252
}
5353
let sentry = sentry::init(sentry::ClientOptions {

0 commit comments

Comments
 (0)