-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New issue related to the new package uvicorn_worker.UvicornWorker
(the last one was deprecated)
#1208
Comments
It sounds like you're having issues due to redundant instrumentation. If you're using Django as the base web framework and a combination of If you weren't seeing data when using
bin/start-pgbouncer-stunnel \
newrelic-admin run-program gunicorn ... Example AppTo help simplify the debugging process, here's a one file example Django application that doesn't use any
import os
from django.http import HttpResponse
from django.urls import path
from django.core.asgi import get_asgi_application
from django.core.wsgi import get_wsgi_application
# Settings
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main")
ROOT_URLCONF = "main"
# Views
def index(request):
return HttpResponse("Hello from Django! (sync view)")
async def async_index(request):
return HttpResponse("Hello from Django! (async view)")
# URLs
urlpatterns = [
path("", index, name="index"),
path("async", async_index, name="async_index"),
]
# ASGI
asgi_application = get_asgi_application()
# WSGI
wsgi_application = get_wsgi_application()
[newrelic]
license_key = <YOUR_LICENSE_KEY>
app_name = django_uvicorn_worker_demo
log_level = debug
log_file = agent.log
audit_log_file = audit.log
startup_timeout = 10.0
transaction_tracer.explain_threshold = 0.0
transaction_tracer.transaction_threshold = 0.0
transaction_tracer.stack_trace_threshold = 0.0
#!/bin/bash
export NEW_RELIC_CONFIG_FILE=newrelic.ini
newrelic-admin run-program gunicorn main:asgi_application -k uvicorn_worker.UvicornWorker
# These also work instead of gunicorn + uvicorn
# newrelic-admin run-program gunicorn main:wsgi_application
# newrelic-admin run-program uvicorn main:asgi_application
|
Mmmm not, I'm not having double instrumentation https://github.com/breatheco-de/apiv2/blob/edffa12373a6f6e9196b08232a5efd032ece8993/breathecode/asgi.py and if this was the case, this couldn't get fixed changing the package from |
I can see double instrumentation in the traceback you've provided, meaning something here is misconfigured. There shouldn't be a WSGI wrapper underneath the ASGI wrapper. The test application I provided should demonstrate that Perhaps your version of |
I should test them later, but if there is double instrumentation, where is it? |
I posted the relevant lines of your traceback, there's a WSGI wrapper on bottom and an ASGI wrapper on top of that. The ASGI wrapper should be the only one, meaning something is interfering with the normal operation of the gunicorn/uvicorn worker. |
All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue. |
That solved my issue breatheco-de/apiv2@1d2d47c...edffa12
Pipfile.lock
https://github.com/breatheco-de/apiv2/blob/edffa12373a6f6e9196b08232a5efd032ece8993/Pipfile.lock#L1
The text was updated successfully, but these errors were encountered: