Skip to content

Conversation

@timmc-edx
Copy link
Contributor

@timmc-edx timmc-edx commented Mar 7, 2025

These changes will cause telemetry to start being reported when annotations are created. (No change for whether notesserver heartbeat calls emit telemetry, as that is currently only supported for New Relic anyhow.)

This also removes the newrelic dependency, though it is still pulled in by edx-django-utils indirectly, for now.

[EDIT: This originally just wrapped the newrelic import in a try block, but the new PR removes newrelic references entirely.]

@nsprenkle
Copy link
Contributor

@timmc-edx , could you point (either in comment here or in code) to the right way to fix this in the long term?

@timmc-edx
Copy link
Contributor Author

Instead of newrelic.agent.add_custom_parameter you'd want to call edx_django_utils.monitoring.set_custom_attribute. Monitoring utils docs: https://github.com/openedx/edx-django-utils/tree/master/edx_django_utils/monitoring

I was just going for the least-work option, but it does look like edx-django-utils is already in the IDA's requirements, so maybe it would be better to just go ahead and make that change. Either way works for me, I'm just clearing the path for a DEPR. :-)

@timmc-edx timmc-edx force-pushed the timmc/no-direct-nr branch from 4a08ad1 to 345c483 Compare March 7, 2025 22:58
@timmc-edx timmc-edx changed the title fix: Allow newrelic import to fail fix: Use edx-django-utils API instead of calling newrelic directly Mar 7, 2025
@timmc-edx
Copy link
Contributor Author

I went back and made the better fix -- PR name and description updated, too.

We should remove newrelic references entirely and replace them with
edx-django-utils calls. This change just unblocks removing newrelic as a
direct dependency.
These changes will cause telemetry to start being reported when
annotations are created. (No change for whether notesserver heartbeat calls
emit telemetry, as that is currently only supported for New Relic anyhow.)

This also removes the newrelic dependency, though it is still pulled in by
edx-django-utils indirectly, for now.
@timmc-edx timmc-edx force-pushed the timmc/no-direct-nr branch from 345c483 to b037599 Compare March 10, 2025 14:27
# via -r requirements/base.in
mysqlclient==2.2.7
# via -r requirements/base.in
newrelic==10.7.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like newrelic is still included in the requirements, is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes -- if you look at the comments below that line, you can see that it's still being pulled in via edx-django-utils (for now).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the future plan for removing it from requirements?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, this was the last instance in the edx and openedx orgs where we still had a direct import newrelic -- so after this merges, I think we're clear to remove newrelic from the edx-django-utils base.in as well. I don't have a specific plan for that, but I did want to clear the path for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: Filed a DEPR for this: openedx/public-engineering#360

@sarina sarina merged commit 51c58ba into openedx:master Mar 11, 2025
16 checks passed
@timmc-edx timmc-edx deleted the timmc/no-direct-nr branch March 11, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants