-
Notifications
You must be signed in to change notification settings - Fork 454
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
Not able to auto-instrument sample python app using flask. #862
Comments
I see the following logs at my application startup: Distribution distro configuration failed Looks like the instrumentation is not starting due to a python version issue. |
I now used a base image of 3.7 version of python and made progress. At least the application got instrumented and trying to emit the traces. However, the export fails with the following: bisnanda@BISNANDA-M-W1CH:/Volumes/Data/AppDynamicsCloud/EKS$ kubectl -n biswa-apps-python logs -f python-downstream-eks-6f95f6f765-xc5gh -c python-downstream-eks
During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): In the sidecar otel collector logs, I am seeing the following: |
Workaround: Found a workaround for this. In my Instrumentation Resource configuration, instead of using exporter endpoint as http://localhost:4317 (GRPC), I used http://localhost:4318/v1/traces (HTTP) and now spans from my python application are being exported successfully to my Otel Collector. However, it still needs to be investigated why the traces fail to export while using GRPC endpoint in my instrumentation resource. |
@biswajit-nanda it doesn't have to be investigated :) Python auto-instrumentation is using OTLP HTTP protocol and only this exporter package is installed. You can find a list of all used packages here |
Thanks for the clarifications, @mat-rumian. I am closing this now. |
Hello, Folks,
I have a very simple python app that I am trying to auto-instrument using the OpenTelemetry Operator. The injection is done and the pod is restarted after adding the annotations, but the python app does not send traces to the otel-collector running as sidecar.
Attached is a zip file PythonTestCase.zip that contains my python app, Dockerfile used to build the image and the yaml file used to deploy the app in K8s. It also contains the yaml file for the instrumentation resource, the yaml file that has the config for my sidecar otel collector, the sidecar otel collector logs and the kubectl describe output for my python application pod.
Steps Followed:
a. The python app was deployed using the attached yaml.
b. Cert Manager was installed.
c. Otel Operator was installed.
d. Deployed the attached SideCar Otel Collector configuration to the namespace where the app was deployed.
e. The instrumentation resource using the attached yaml was deployed to the same namespace where the app is deployed.
f. Required pod level annotations were added to the application deployment using the command below:
kubectl -n biswa-apps-python patch deployment python-downstream-eks -p '{"spec": {"template": {"metadata": {"annotations": {"sidecar.opentelemetry.io/inject":"true","instrumentation.opentelemetry.io/inject-python":"true"}}}}}'
g. Load was applied on the application pod from browser at: http://localhost:8080/hello after doing a K8s port forward.
Observations:
After applying the path, the application pod gets restarted as expected, the init container is created successfully and the copy task is performed successfully and the sidecar otel collector container is automatically added to the application pod. However, the traces from the application never make their way to the sidecar otel collector. I am verifying this by adding the debug level logging exported in the sidecar otel collector config.
I am not sure if I am missing something very obvious here or this is a bug or flask is not supported.
Environment:
K8s Version: 1.22.6 (Amazon EKS)
Otel Collector Version: v0.49.0 (automatically pulled by the operator)
Python Version: 3.6.15
OpenTelemetry Operator Version: latest (deployed from https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml)
Cert Manager Version: 1.7.1 (deployed from https://github.com/cert-manager/cert-manager/releases/download/v1.7.1/cert-manager.yaml)
Could someone kindly help me out here? I am running out of ideas now.
PythonTestCase.zip
The text was updated successfully, but these errors were encountered: