openedx / edx-django-utils

edX utilities for Django Application development.
https://edx.readthedocs.io/projects/edx-django-utils/en/latest/
Apache License 2.0
26 stars 20 forks source link

Remove optional import of newrelic #396

Closed timmc-edx closed 6 months ago

timmc-edx commented 7 months ago

edx-django-utils.monitoring currently does a try-import of the newrelic package and then sets a flag if the import fails. This is a historical artifact that is no longer needed; we can just import newrelic.agent directly and drop any if newrelic: checks.

Archaeological notes:

robrap commented 7 months ago

Thanks for the history.

If a deployment had removed this dependency, even for an outdated reason, this would cause a backward-incompatibility. I don’t think we should change anything around this until this code is no longer run by default in the first place.

timmc-edx commented 7 months ago

I think someone would have to go to some lengths to avoid having it installed, as it's currently pulled in automatically. I don't think it would be a big deal to do a major-version bump and remove the conditionals. But it's certainly not urgent; the main reason I filed this ticket was just to have a place to link to in a comment. :-)

robrap commented 6 months ago

@timmc-edx will look at this to determine whether to backlog or close.

timmc-edx commented 6 months ago

I'm going to go ahead and close this for now. With the work in https://github.com/openedx/edx-django-utils/pull/397 we might be moving towards a situation where we can contain all of the New Relic references to a single plugin, and at that point it might be relatively straightforward to move newrelic from base to testing dependencies. But it's too early to say at this point.