appsignal/appsignal-python

Installer should offer to install relevant dependencies

unflxw opened this issue · 2 comments

The installer should install the relevant OpenTelemetry dependencies for your project and suggest relevant next steps after installation.

For example, if your requirements.txt contains django, then we should offer to add opentelemetry-instrumentation-django to the requirements.txt for you. This is important because the dependency being installed is what will cause AppSignal to start that instrumentation. The same could be done for all other instrumentations.

The installer should also give you potential "next steps" instructions based on those dependencies. For example, if it installed opentelemetry-instrumentation-django for you, then it should suggest that you add the code snippet that initialises AppSignal to your manage.py file. For many instrumentations, there will be no obvious "next step" that is more specific than the generic "add this to your application's entrypoint" -- that's okay.

I don't think we need to run pip install for users after we add the new dependencies, but we could. I don't think we need to write the initialise code to manage.py ourselves, either.

To do

  • Detect relevant existing dependencies from requirements.txt
  • Write relevant OpenTelemetry dependencies to requirements.txt
  • Suggest relevant next steps based on dependencies: install/config steps or link to docs

This is a wishlist -- if any part of this is hard, consider dropping it. For example, maybe we can just tell users which dependencies they need to add instead of writing them to the file ourselves.

Edited this issue to remove mentions of pyproject.toml -- applications should not specify their dependencies in pyproject.toml, they should use requirements.txt instead.