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

Modify installation instructions to use import appsignal #201

Merged
merged 1 commit into from
Mar 19, 2024
Merged
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
24 changes: 17 additions & 7 deletions src/appsignal/cli/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

INSTALL_FILE_NAME = "__appsignal__.py"

WARNING_EMOJI = "\u26A0\ufe0f"
unflxw marked this conversation as resolved.
Show resolved Hide resolved


class InstallCommand(AppsignalCLICommand):
"""Generate Appsignal client integration code."""
Expand Down Expand Up @@ -123,9 +125,11 @@ def _django_installation(self) -> None:
print()
self._add_dependency("opentelemetry-instrumentation-django")

print("Django requires some manual configuration.")
print("The __appsignal__ module needs to be imported in the manage.py file")
print("and the appsignal.start() method needs to be called in the main method.")
print(f"{WARNING_EMOJI} Django requires some manual configuration.")
print(
"AppSignal needs to be imported and started at your Django application's "
"entry points."
)
print()
print("Please refer to the documentation for more information:")
print("https://docs.appsignal.com/python/instrumentations/django.html")
Expand All @@ -139,20 +143,26 @@ def _flask_installation(self) -> None:
print()
self._add_dependency("opentelemetry-instrumentation-flask")

print("Flask requires some manual configuration.")
print("The __appsignal__ module needs to be imported before Flask is imported")
print("and the appsignal.start() method needs to be called right after.")
print(f"{WARNING_EMOJI} Flask requires some manual configuration.")
print(
"AppSignal needs to be imported and initialized before Flask is imported."
)
print()
print(" import appsignal")
print(" appsignal.start()")
print(" import flask")
print()
print("Please refer to the documentation for more information:")
print("https://docs.appsignal.com/python/instrumentations/flask.html")

def _generic_installation(self) -> None:
print("✅ Done! AppSignal for Python has now been installed.")
print()
print(f"{WARNING_EMOJI} Some manual configuration might be required.")
print("To start AppSignal in your application, add the following code to your")
print("application's entrypoint:")
print()
print(" from __appsignal__ import appsignal")
print(" import appsignal")
print(" appsignal.start()")
print()
print("You can check a list of the supported integrations here:")
Expand Down
Loading