fix: opt-in model

This commit is contained in:
NanoCode012
2025-10-27 15:22:46 +07:00
parent 107c67ae5a
commit 7fd4edd5a9
2 changed files with 18 additions and 21 deletions

View File

@@ -1,6 +1,6 @@
--- ---
title: Telemetry title: Telemetry
description: A description of the opt-in telemetry implementation in Axolotl. description: A description of the telemetry implementation in Axolotl.
--- ---
# Telemetry in Axolotl # Telemetry in Axolotl
@@ -39,16 +39,15 @@ runtime metrics telemetry.
The telemetry system will block training startup for 15 seconds to ensure users are The telemetry system will block training startup for 15 seconds to ensure users are
aware of data collection, unless telemetry is explicitly enabled or disabled. aware of data collection, unless telemetry is explicitly enabled or disabled.
## Opt-In Mechanism ## Opt-Out Mechanism
Telemetry is **disabled by default** on an opt-in basis. To enable it, set `AXOLOTL_DO_NOT_TRACK=0`. Telemetry is **enabled by default** on an opt-out basis. To disable it, set
`AXOLOTL_DO_NOT_TRACK=1` or `DO_NOT_TRACK=1`.
To remove the warning message about telemetry that is displayed on train, etc. startup, To remove the warning message about telemetry that is displayed on train, etc. startup,
explicitly set: `AXOLOTL_DO_NOT_TRACK=0` (enable telemetry) or `AXOLOTL_DO_NOT_TRACK=1` explicitly set: `AXOLOTL_DO_NOT_TRACK=0` (enable telemetry) or `AXOLOTL_DO_NOT_TRACK=1`
(explicitly disable telemetry). (explicitly disable telemetry).
**Note**: Telemetry will move to an opt-out model in a later release.
## Privacy ## Privacy
- All path-like config information is automatically redacted from telemetry data - All path-like config information is automatically redacted from telemetry data

View File

@@ -20,20 +20,19 @@ LOG = logging.getLogger(__name__)
POSTHOG_HOST = "https://app.posthog.com" POSTHOG_HOST = "https://app.posthog.com"
POSTHOG_WRITE_KEY = "phc_1kUR0o04oJKKTTeSsIz2Mfm5mpiVsQEf2WOlzljMD7y" POSTHOG_WRITE_KEY = "phc_1kUR0o04oJKKTTeSsIz2Mfm5mpiVsQEf2WOlzljMD7y"
OPT_IN_WARNING_SLEEP_SECONDS = 10 OPT_OUT_WARNING_SLEEP_SECONDS = 10
OPT_IN_WARNING = ( OPT_OUT_WARNING = (
"\nTelemetry is currently disabled by default. If you'd like to help improve " "\nTelemetry is now enabled by default to help improve Axolotl. "
"Axolotl, consider enabling it by setting AXOLOTL_DO_NOT_TRACK=0 in your environment.\n\n" "If you'd like to disable it, set AXOLOTL_DO_NOT_TRACK=1 in your environment.\n\n"
"Telemetry data helps us understand:\n" "Telemetry data helps us understand:\n"
"- Which features are most used\n" "- Which features are most used\n"
"- What hardware configurations to prioritize\n" "- What hardware configurations to prioritize\n"
"- Where users encounter errors\n\n" "- Where users encounter errors\n\n"
"Personally identifiable information (PII) is not collected.\n\n" "Personally identifiable information (PII) is not collected.\n\n"
"To remove this warning, explicitly set AXOLOTL_DO_NOT_TRACK=0 (enable telemetry) " "To remove this warning, explicitly set AXOLOTL_DO_NOT_TRACK=0 (enable telemetry) "
"or AXOLOTL_DO_NOT_TRACK=1 (explicitly disable telemetry).\n\n" "or AXOLOTL_DO_NOT_TRACK=1 (disable telemetry).\n\n"
"Note: Telemetry will move to an opt-out in a later release.\n\n" "For details, see: https://docs.axolotl.ai/docs/telemetry.html\n\n"
"For details, see: https://axolotl-ai-cloud.github.io/axolotl/docs/telemetry.html\n\n" f"Sleeping for {OPT_OUT_WARNING_SLEEP_SECONDS}s..."
f"Sleeping for {OPT_IN_WARNING_SLEEP_SECONDS}s..."
) )
WHITELIST_PATH = str(Path(__file__).parent / "whitelist.yaml") WHITELIST_PATH = str(Path(__file__).parent / "whitelist.yaml")
@@ -166,9 +165,8 @@ class TelemetryManager:
whether this is the main process (for the distributed setting and to avoid whether this is the main process (for the distributed setting and to avoid
sending duplicate PostHog events per GPU). sending duplicate PostHog events per GPU).
Note: This is disabled by default on an opt-in basis. Set Note: This is enabled by default on an opt-out basis. Set
`AXOLOTL_DO_NOT_TRACK=0` to enable telemetry. We plan to move to an opt-out `AXOLOTL_DO_NOT_TRACK=1` to disable telemetry. For more details, see
model in a later release. For more details, see
https://axolotl-ai-cloud.github.io/axolotl/docs/telemetry.html. https://axolotl-ai-cloud.github.io/axolotl/docs/telemetry.html.
Returns: Returns:
@@ -178,19 +176,19 @@ class TelemetryManager:
axolotl_do_not_track = os.getenv("AXOLOTL_DO_NOT_TRACK") axolotl_do_not_track = os.getenv("AXOLOTL_DO_NOT_TRACK")
do_not_track = os.getenv("DO_NOT_TRACK") do_not_track = os.getenv("DO_NOT_TRACK")
# Default to disabled (opt-in model for initial release) # Default to enabled (opt-out model)
if axolotl_do_not_track is None or axolotl_do_not_track.lower() not in ( if axolotl_do_not_track is None or axolotl_do_not_track.lower() not in (
"0", "0",
"1", "1",
"false", "false",
"true", "true",
): ):
# Print opt-in info message for main process only # Print opt-out info message for main process only
if is_main_process(): if is_main_process():
LOG.warning(OPT_IN_WARNING) LOG.warning(OPT_OUT_WARNING)
time.sleep(OPT_IN_WARNING_SLEEP_SECONDS) time.sleep(OPT_OUT_WARNING_SLEEP_SECONDS)
return False return True
# Only rank 0 will send telemetry # Only rank 0 will send telemetry
if not is_main_process(): if not is_main_process():