aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Reinier van der Leer <pwuts@agpt.co> 2024-02-15 14:46:36 +0100
committerGravatar Reinier van der Leer <pwuts@agpt.co> 2024-02-15 14:46:36 +0100
commitb7f08cd0f7ce1b7443437fa5ffd1374eab064ed0 (patch)
tree5705431721fbed60f04997d9186517d5bb31f8e6
parentfix(forge): Make `watchfiles` pattern more specific to prevent unwanted (brea... (diff)
downloadAuto-GPT-b7f08cd0f7ce1b7443437fa5ffd1374eab064ed0.tar.gz
Auto-GPT-b7f08cd0f7ce1b7443437fa5ffd1374eab064ed0.tar.bz2
Auto-GPT-b7f08cd0f7ce1b7443437fa5ffd1374eab064ed0.zip
feat(agent/telemetry): Enable performance tracing & update opt-in prompt accordingly
-rw-r--r--autogpts/autogpt/autogpt/app/telemetry.py36
1 files changed, 22 insertions, 14 deletions
diff --git a/autogpts/autogpt/autogpt/app/telemetry.py b/autogpts/autogpt/autogpt/app/telemetry.py
index c3a6aef72..d89e4e6c7 100644
--- a/autogpts/autogpt/autogpt/app/telemetry.py
+++ b/autogpts/autogpt/autogpt/app/telemetry.py
@@ -1,6 +1,7 @@
import os
import click
+from colorama import Fore, Style
from .utils import env_file_exists, get_git_user_email, set_env_config_value
@@ -12,25 +13,31 @@ def setup_telemetry() -> None:
if not env_file_exists():
return
- print()
allow_telemetry = click.prompt(
- "❓ Do you want to enable telemetry? ❓\n"
- "This means AutoGPT will send diagnostic data to the core development team "
- "when something goes wrong,\n"
- "and will help us to diagnose and fix problems earlier and faster.\n"
- "\n"
- "By entering 'yes', you confirm that you have read and agree to our "
- "Privacy Policy, which is available here:\n"
- "https://www.notion.so/auto-gpt/Privacy-Policy-ab11c9c20dbd4de1a15dcffe84d77984\n" # noqa
- "\n"
- "Please enter 'yes' or 'no'",
+ f"""
+{Style.BRIGHT}❓ Do you want to enable telemetry? ❓{Style.NORMAL}
+This means AutoGPT will send diagnostic data to the core development team when something
+goes wrong, and will help us to diagnose and fix problems earlier and faster. It also
+allows us to collect basic performance data, which helps us find bottlenecks and other
+things that slow down the application.
+
+By entering 'yes', you confirm that you have read and agree to our Privacy Policy,
+which is available here:
+https://www.notion.so/auto-gpt/Privacy-Policy-ab11c9c20dbd4de1a15dcffe84d77984
+
+Please enter 'yes' or 'no'""",
type=bool,
)
set_env_config_value("TELEMETRY_OPT_IN", "true" if allow_telemetry else "false")
- print(
- "💡 If you ever change your mind, you can adjust 'TELEMETRY_OPT_IN' in .env"
+ click.echo(
+ f"❤️ Thank you! Telemetry is {Fore.GREEN}enabled{Fore.RESET}."
+ if allow_telemetry
+ else f"👍 Telemetry is {Fore.RED}disabled{Fore.RESET}."
)
- print()
+ click.echo(
+ "💡 If you ever change your mind, you can change 'TELEMETRY_OPT_IN' in .env"
+ )
+ click.echo()
if os.getenv("TELEMETRY_OPT_IN", "").lower() == "true":
_setup_sentry()
@@ -41,6 +48,7 @@ def _setup_sentry() -> None:
sentry_sdk.init(
dsn="https://dc266f2f7a2381194d1c0fa36dff67d8@o4505260022104064.ingest.sentry.io/4506739844710400", # noqa
+ enable_tracing=True,
environment=os.getenv("TELEMETRY_ENVIRONMENT"),
)