:wave: Hello, team! I am new to the SigNoz and wo...
# support
d
👋 Hello, team! I am new to the SigNoz and would like to find out how the instrumentation is done for Python. I tried to follow instructions in https://signoz.io/opentelemetry/python/ but run into some errors below: I tried to add a task in the demo app and got the message below:
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
I also see messages from the server:
[2022-01-03 033608,796] ERROR in app: Exception on /action [POST]
Traceback (most recent call last):
 File "/home/david.fang/.local/lib/python3.6/site-packages/flask/app.py", line 2073, in wsgi_app
  response = self.full_dispatch_request()
 File "/home/david.fang/.local/lib/python3.6/site-packages/flask/app.py", line 1518, in full_dispatch_request
  rv = self.handle_user_exception(e)
 File "/home/david.fang/.local/lib/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
  rv = self.dispatch_request()
 File "/home/david.fang/.local/lib/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
  return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
 File "app.py", line 76, in action
  todos.insert({ "name":name, "desc":desc, "date":date, "pr":pr, "done":"no"})
 File "/home/david.fang/.local/lib/python3.6/site-packages/pymongo/collection.py", line 2587, in call
  self.__name.split(".")[-1])
TypeError: 'Collection' object is not callable. If you meant to call the 'insert' method on a 'Collection' object it is failing because no such method exists.
10.34.8.1 - - [03/Jan/2022 033608] "POST /action HTTP/1.1" 500 -
Please shed some lights. Thanks! PS I already tried installing the pymongo module. Also is there any more information/tutorial/example for me to learn how python's instrumentation is done?
p
Thanks for posting the issue @User @User Can you have a look at this
v
@User 1. Are you running mongodb on your system? 2. Were you able to run python app without instrumentation? https://signoz.io/opentelemetry/python/#installing-sample-python-app I just checked on my system and it is running fine.
d
Hi @User, Yes, I installed the mongodb and it has been running. I did not try the app before the instrumentation step. How do I back out the instrumentation and try?
I downloaded the https://github.com/SigNoz/sample-flask-app.git again in separate location and just run "python3 app.py" it's still giving same error when I tried to add a task.
v
Can you please run
pip3 freeze
and check which version of flask, pymongo and requests are installed? Are you able to view the homepage for the sample todo app?
Also did you clone the app from here: https://github.com/SigNoz/sample-flask-app?
d
@User, the sample todo app seems to run fine: Here is the output from pip3 freeze:
Copy code
adal==1.2.7
aiocontextvars==0.2.2
backoff==1.10.0
backports.zoneinfo==0.2.1
boto==2.49.0
bson==0.5.10
cachetools==4.2.2
cdiff==1.0
certifi==2021.5.30
cffi==1.14.6
charset-normalizer==2.0.4
click==8.0.1
contextvars==2.4
cryptography==3.4.8
dataclasses==0.8
Deprecated==1.2.13
dnspython==2.1.0
Flask==2.0.2
google-auth==2.0.2
googleapis-common-protos==1.54.0
grpcio==1.43.0
idna==3.2
immutables==0.16
importlib-metadata==4.8.1
importlib-resources==5.2.2
itsdangerous==2.0.1
Jinja2==3.0.3
kazoo==2.8.0
kubernetes==7.0.0
MarkupSafe==2.0.1
oauthlib==3.1.1
opentelemetry-api==1.7.1
opentelemetry-distro==0.26b1
opentelemetry-exporter-otlp==1.7.1
opentelemetry-exporter-otlp-proto-grpc==1.7.1
opentelemetry-exporter-otlp-proto-http==1.7.1
opentelemetry-instrumentation==0.26b1
opentelemetry-instrumentation-aws-lambda==0.26b1
opentelemetry-instrumentation-boto==0.26b1
opentelemetry-instrumentation-dbapi==0.26b1
opentelemetry-instrumentation-flask==0.26b1
opentelemetry-instrumentation-grpc==0.26b1
opentelemetry-instrumentation-jinja2==0.26b1
opentelemetry-instrumentation-logging==0.26b1
opentelemetry-instrumentation-psycopg2==0.26b1
opentelemetry-instrumentation-requests==0.26b1
opentelemetry-instrumentation-sqlite3==0.26b1
opentelemetry-instrumentation-urllib==0.26b1
opentelemetry-instrumentation-urllib3==0.26b1
opentelemetry-instrumentation-wsgi==0.26b1
opentelemetry-propagator-aws-xray==1.0.1
opentelemetry-proto==1.7.1
opentelemetry-sdk==1.7.1
opentelemetry-semantic-conventions==0.26b1
opentelemetry-util-http==0.26b1
patroni==2.1.1
prettytable==2.2.0
protobuf==3.19.1
psutil==5.8.0
psycopg2==2.7.7
psycopg2-binary==2.9.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
PyJWT==2.1.0
pymongo==4.0.1
python-consul==1.1.0
python-dateutil==2.8.2
python-etcd==0.4.5
PyYAML==5.4.1
requests==2.26.0
requests-oauthlib==1.3.0
rsa==4.7.2
six==1.16.0
typing-extensions==3.10.0.2
tzlocal==3.0
urllib3==1.26.6
wcwidth==0.2.5
websocket-client==1.2.1
Werkzeug==2.0.2
wrapt==1.13.3
ydiff==1.2
zipp==3.5.0
Oh and yes, I cloned the app from same location
v
Found the issue! pymongo v4 has deprecated some of the functions which is causing the issue, please install pymongo 3.12.1 by using this command:
pip3 install pymongo==3.12.1
Also I will update the pymongo version in requirements.txt.
d
Thanks Vishal, that mongodb upgrade fixed the app.py so I could enter tasks in the TODO. however, the SigNoz dashboard is no longer working (cannot be reached) after the upgrade.. I got same response using curl on the host..
nevermind.. I re-run the install.sh for SigNoz and it's coming up
The next issue now is that the tasks I entered today not showing completed after a couple hours.
v
@User The sample app doesn’t auto completes the tasks.
d
Oh ok. I thought the sample app would run and complete tasks and the SigNoz can monitor while the app is doing the work.
How do I use the sample app?
v
You have to manually perform sample app and the trace and metrics events will be automatically sent to SigNoz