Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions newrelic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import threading
import time
import traceback
from datetime import datetime, timezone
from pathlib import Path

import newrelic.api.application
Expand Down Expand Up @@ -54,6 +55,8 @@

_logger = logging.getLogger(__name__)

DEPRECATED_MODULES = {"aioredis": datetime(2022, 2, 22, 0, 0, tzinfo=timezone.utc)}


def _map_aws_account_id(s):
return newrelic.core.config._map_aws_account_id(s, _logger)
Expand Down Expand Up @@ -1105,6 +1108,18 @@ def _module_import_hook(target, module, function):
def _instrument(target):
_logger.debug("instrument module %s", ((target, module, function),))

# Deprecation warning for archived/unsupported modules
library_name = target.__package__.split(".")[0]

if library_name in DEPRECATED_MODULES:
_logger.warning(
"%(module)s has been archived by the developers "
"and has not been supported since %(date)s. %(module)s "
"support will be removed from New Relic in a future "
"release.",
{"module": library_name, "date": DEPRECATED_MODULES[library_name].strftime("%B %d, %Y")},
)

try:
instrumented = target._nr_instrumented
except AttributeError:
Expand Down
Loading