Skip to content

Commit

Permalink
Merge pull request #201 from appsignal/modify-installation-appsignal-…
Browse files Browse the repository at this point in the history
…start

Modify installation instructions to use `import appsignal`
  • Loading branch information
unflxw authored Mar 19, 2024
2 parents 60967b6 + 256b455 commit 232c037
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 232c037

Please sign in to comment.