21 Jun 2022 09:34 PM - last edited on 22 Jun 2022 02:00 AM by MaciejNeumann
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:
Solved! Go to Solution.
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.
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.
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?
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.