22 Jun 2022 05:34 AM - last edited on 22 Jun 2022 10:00 AM by MaciejNeumann
Hello,
I recently got to know about dynatrace , so I want to use to monitor my cassandra cql queries executed by python flask applications. All the Cassandra and services are in docker container so how can I do that ?
I tried by enabling cql and java cql driver but no queries shows up. I have installed dynatrace one agent in my local machine.
A bit more information, I want to use the database monitoring tool as explained in this blog:
https://www.dynatrace.com/news/blog/cassandra-cql3-support-coming-dynatrace/
Solved! Go to Solution.
22 Jun 2022 07:15 AM
Dynatrace does not have built-in auto-instrumentation for Python without code changes and relies on either OpenTelemetry, OneAgent SDK manual or OneAgent SDK autoinstrumentation.
All those methods require touching your container image and Python code. If you use any libraries supported by the OneAgent SDK autoinstrumentation, you might want to try that first. (Flask is supported, not sure about the Cassandra library you are using). If this does not work, go for the OpenTelemetry approach.
22 Jun 2022 08:25 AM
I am using cassandra offical python library.
22 Jun 2022 08:59 AM
This does not seem to be supported by autodynatrace (OneAgent SDK autoinstrumentation), so you should look towards using OpenTelemetry. As you mention you are running it in a container, most likely you will need to send the data using Trace Ingest API. So on the page https://www.dynatrace.com/support/help/shortlink/opent-python in the section "Send data to Dynatrace" use the "Without OneAgent" method.
FYI - the OneAgent method relies on the local endpoint (http://localhost:14499) which will probably will not be available in your container.
22 Jun 2022 09:07 AM
Yes I am running the Cassandra database in docker container and the flask app in a seperate container.then I connect that app to Cassandra database using Cassandra driver to the exposed container port. So is this approach valid for this case?
22 Jun 2022 12:27 PM
Sure. You should need to add opentelemetry instrumentation only to your container running your Flask app. Actually, my point was about getting the trace data out of the app as the local ingest port probably won't be available from the container unless you are using host network for the container.