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 not displaying in Dynatrace after enabling AutoInstrumentation #66

Closed phillamb168 closed 1 year ago

phillamb168 commented 1 year ago

Howdy,

We're using v1.250 of Dynatrace for monitoring a Rancher kubernetes cluster running the Dynatrace Operator (v0.6.0). We have several microservices for each environment, including React and Python. The React / Remix services are detected and can be accessed via Dynatrace without issue. However, when I attempt to enable autoinstrumentation for our Python services, nothing appears on the services list in Dynatrace.

Here's an example Dockerfile that's used to build the image we have running in staging. Is there anything in particular that I should be doing here that I'm not?

FROM ubuntu:focal

ARG DEBIAN_FRONTEND=noninteractive

# necessary for python install
ARG TZ=America/Los_Angeles

# install python (ubuntu python3 is 3.8, so specify 3.10 explicitly)
RUN apt update && \
    apt upgrade -y && \
    apt install software-properties-common -y && \
    add-apt-repository ppa:deadsnakes/ppa -y && \
    apt install python3.10 python3.10-distutils curl -y && \
    ln -fs /usr/bin/python3.10 /usr/bin/python3 && \
    curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
    python3 get-pip.py && rm get-pip.py

WORKDIR /app

COPY src/*.py src/
COPY README.md .
COPY CHANGELOG.md .
COPY requirements.txt .

# PIP dependencies
RUN pip3 install -r requirements.txt

# install only the chromium browser for playwright
RUN playwright install chromium --with-deps

# clean apt cache
RUN rm -rf /var/lib/apt/lists/*

ENV AUTODYNATRACE_LOG_LEVEL DEBUG
ENV AUTODYNATRACE_FORKABLE true
ENV AUTOWRAPT_BOOTSTRAP autodynatrace

EXPOSE 80/tcp

CMD [ "gunicorn", "--preload", "--workers=3", "--bind=0.0.0.0:80", "--pythonpath=src", "api:app" ]

And this is part of ourrequirements.txt :

gunicorn==20.1.0
autodynatrace==1.0.86

I'm not sure where to start for debugging this. I know the cluster is talking to DT because I have plenty of telemetry from other non-Python services. Thanks in advance!

dlopes7 commented 1 year ago

Sorry about not replying earlier, but we need the console output of that pod to understand what is going on here, this would show the DEBUG logs of autodynatrace