Skip to content

Commit

Permalink
stop test telemetry logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bboynton97 committed Jan 7, 2025
1 parent f8c1220 commit 4008fa9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion agentstack/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# cool of you to allow telemetry <3
#
# - braelyn

import os

Check warning on line 24 in agentstack/telemetry.py

View check run for this annotation

Codecov / codecov/patch

agentstack/telemetry.py#L24

Added line #L24 was not covered by tests
import platform
import socket
from typing import Optional
Expand Down Expand Up @@ -76,6 +76,9 @@ def collect_machine_telemetry(command: str):


def track_cli_command(command: str, args: Optional[str] = None):
if bool(os.environ['AGENTSTACK_NO_TEST_TELEMETRY']):
return

Check warning on line 80 in agentstack/telemetry.py

View check run for this annotation

Codecov / codecov/patch

agentstack/telemetry.py#L80

Added line #L80 was not covered by tests

try:
data = collect_machine_telemetry(command)
headers = {}
Expand All @@ -88,6 +91,9 @@ def track_cli_command(command: str, args: Optional[str] = None):
pass

def update_telemetry(id: int, result: int, message: Optional[str] = None):
if bool(os.environ['AGENTSTACK_NO_TEST_TELEMETRY']):
return

Check warning on line 95 in agentstack/telemetry.py

View check run for this annotation

Codecov / codecov/patch

agentstack/telemetry.py#L95

Added line #L95 was not covered by tests

try:
requests.put(TELEMETRY_URL, json={"id": id, "result": result, "message": message})
except Exception:
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ commands =
coverage report -m
coverage xml
mypy: mypy agentstack
setenv =
setenv =
AGENTSTACK_NO_TEST_TELEMETRY = 1
AGENTSTACK_TELEMETRY_OPT_OUT = 1
AGENTSTACK_UPDATE_DISABLE = 1

Expand Down

0 comments on commit 4008fa9

Please sign in to comment.