Skip to content

Commit

Permalink
Merge branch 'main' into capture-host-port-info-pymemcache
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Sep 17, 2024
2 parents 9768bb9 + d642980 commit b655210
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion newrelic/core/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def environment_settings():
dispatcher.append(("Dispatcher", "gunicorn (gevent)"))
elif "gunicorn.workers.geventlet" in sys.modules:
dispatcher.append(("Dispatcher", "gunicorn (eventlet)"))
elif "uvicorn.workers" in sys.modules:
elif "uvicorn.workers" in sys.modules or "uvicorn_worker" in sys.modules:
dispatcher.append(("Dispatcher", "gunicorn (uvicorn)"))
uvicorn = sys.modules.get("uvicorn")
if hasattr(uvicorn, "__version__"):
Expand Down
11 changes: 11 additions & 0 deletions tests/agent_unittests/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ def test_plugin_list_uses_no_sys_modules_iterator(monkeypatch):
"1.2.3",
"4.5.6",
),
# New replacement module uvicorn_worker should function the same
(
{
"gunicorn": module("1.2.3"),
"uvicorn": module("4.5.6"),
"uvicorn_worker": object(),
},
"gunicorn (uvicorn)",
"1.2.3",
"4.5.6",
),
({"uvicorn": object()}, "uvicorn", None, None),
(
{
Expand Down

0 comments on commit b655210

Please sign in to comment.