dynatrace-oss / OneAgent-SDK-Python-AutoInstrumentation

autodynatrace, a python library that implements automatic instrumentation using the OneAgent SDK for Python
Other
62 stars 28 forks source link

Python Gunicorn service request not getting traced using autoinstrumentation in Dynatrace UI #73

Closed ConnectWise-Lalit closed 1 year ago

ConnectWise-Lalit commented 1 year ago

Our Python Gunicorn service not getting autoinstrumented using autodynatrace

ENV variables are set as bellow

#autodynatrace env's
ENV AUTOWRAPT_BOOTSTRAP="autodynatrace"
ENV AUTODYNATRACE_CAPTURE_HEADERS=True
ENV AUTODYNATRACE_FORKABLE=True
ENV AUTODYNATRACE_INSTRUMENT_REDIS=True
ENV AUTODYNATRACE_LOG_LEVEL=DEBUG

Also tried using setting - ENV AUTODYNATRACE_INSTRUMENT_GUNICORN=True - Didnot helped.

Gunicorn library version used - gunicorn[gevent]==20.0.4

dlopes7 commented 1 year ago

With gunicorn (or anything that spawn child processes) we are limited by the OneAgent for C/C++ architecture.

We can either instrument gunicorn (the parent process) OR the children (the actual app that handles the requests). Not both.

Most customers opt to instrument the children, gunicorn metrics (http request count per status for instance) can still be ingested via the OneAgent statsd listener, you just don't get the purepaths starting in gunicorn, which don't provide any extra value anyways.

Documentation about the architecture is here