Skip to content

Commit

Permalink
Modify installation instructions
Browse files Browse the repository at this point in the history
Add a warning emoji whenever manual instrumentation is required,
that is, always.

For Django's instructions, refer to the modification needed as a
generic "your entrypoints" and leave it for the docs to explain
further.

Change other instructions to use `import appsignal`, replacing the
use of `from __appsignal__ import appsignal`.
  • Loading branch information
unflxw committed Mar 18, 2024
1 parent 4e14a09 commit 256b455
Showing 1 changed file with 17 additions and 7 deletions.
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"


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

0 comments on commit 256b455

Please sign in to comment.