Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop test telemetry logging #194

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 track_cli_command(command: str, args: Optional[str] = None):
if bool(os.environ['AGENTSTATCK_IS_TEST_ENV']):
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 @@
pass

def update_telemetry(id: int, result: int, message: Optional[str] = None):
if bool(os.environ['AGENTSTATCK_IS_TEST_ENV']):
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 =
AGENTSTATCK_IS_TEST_ENV = 1
AGENTSTACK_TELEMETRY_OPT_OUT = 1
AGENTSTACK_UPDATE_DISABLE = 1

Expand Down
Loading