personal memory agent
0

Configure Feed

Select the types of activity you want to include in your feed.

Disable OpenTelemetry SDK by default

+35 -7
+3 -2
solstone/__init__.py
··· 9 9 10 10 from solstone.log_policy import apply_http_logging_policy 11 11 12 - # HuggingFace Hub reads this at import time. Default telemetry off before any 13 - # optional provider path can import huggingface_hub. 12 + # HuggingFace Hub and OpenTelemetry-compatible SDKs read these at import/init 13 + # time. Default telemetry off before any optional provider path can import them. 14 14 os.environ.setdefault("HF_HUB_DISABLE_TELEMETRY", "1") 15 15 os.environ.setdefault("DO_NOT_TRACK", "1") 16 + os.environ.setdefault("OTEL_SDK_DISABLED", "true") 16 17 17 18 try: 18 19 __version__ = _pkg_version("solstone")
+32 -5
tests/test_telemetry_env.py
··· 7 7 import subprocess 8 8 import sys 9 9 10 + TELEMETRY_ENV_KEYS = { 11 + "HF_HUB_DISABLE_TELEMETRY", 12 + "DO_NOT_TRACK", 13 + "OTEL_SDK_DISABLED", 14 + } 10 15 11 - def test_huggingface_telemetry_env_defaults_set_at_import(): 16 + 17 + def test_telemetry_env_defaults_set_at_import(): 12 18 env = { 13 - key: value 14 - for key, value in os.environ.items() 15 - if key not in {"HF_HUB_DISABLE_TELEMETRY", "DO_NOT_TRACK"} 19 + key: value for key, value in os.environ.items() if key not in TELEMETRY_ENV_KEYS 16 20 } 17 21 18 22 result = subprocess.run( ··· 23 27 "import os; " 24 28 "import solstone; " 25 29 "assert os.environ['HF_HUB_DISABLE_TELEMETRY'] == '1'; " 26 - "assert os.environ['DO_NOT_TRACK'] == '1'" 30 + "assert os.environ['DO_NOT_TRACK'] == '1'; " 31 + "assert os.environ['OTEL_SDK_DISABLED'] == 'true'" 32 + ), 33 + ], 34 + env=env, 35 + check=False, 36 + text=True, 37 + capture_output=True, 38 + ) 39 + 40 + assert result.returncode == 0, result.stderr 41 + 42 + 43 + def test_otel_env_default_preserves_explicit_value(): 44 + env = {**os.environ, "OTEL_SDK_DISABLED": "false"} 45 + 46 + result = subprocess.run( 47 + [ 48 + sys.executable, 49 + "-c", 50 + ( 51 + "import os; " 52 + "import solstone; " 53 + "assert os.environ['OTEL_SDK_DISABLED'] == 'false'" 27 54 ), 28 55 ], 29 56 env=env,