Skip to content

Commit 6bcbe71

Browse files
authored
Merge pull request #194 from AgentOps-AI/no-test-telemetry
stop test telemetry logging
2 parents e7d25d2 + dd6b15b commit 6bcbe71

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

agentstack/telemetry.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# cool of you to allow telemetry <3
2222
#
2323
# - braelyn
24-
24+
import os
2525
import platform
2626
import socket
2727
from typing import Optional
@@ -76,6 +76,9 @@ def collect_machine_telemetry(command: str):
7676

7777

7878
def track_cli_command(command: str, args: Optional[str] = None):
79+
if bool(os.environ['AGENTSTATCK_IS_TEST_ENV']):
80+
return
81+
7982
try:
8083
data = collect_machine_telemetry(command)
8184
headers = {}
@@ -88,6 +91,9 @@ def track_cli_command(command: str, args: Optional[str] = None):
8891
pass
8992

9093
def update_telemetry(id: int, result: int, message: Optional[str] = None):
94+
if bool(os.environ['AGENTSTATCK_IS_TEST_ENV']):
95+
return
96+
9197
try:
9298
requests.put(TELEMETRY_URL, json={"id": id, "result": result, "message": message})
9399
except Exception:

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ commands =
1717
coverage report -m
1818
coverage xml
1919
mypy: mypy agentstack
20-
setenv =
20+
setenv =
21+
AGENTSTATCK_IS_TEST_ENV = 1
2122
AGENTSTACK_TELEMETRY_OPT_OUT = 1
2223
AGENTSTACK_UPDATE_DISABLE = 1
2324

0 commit comments

Comments
 (0)