Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to monitor cql queries on cassandra docker containers running on host ?



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:




DynaMight Legend
DynaMight Legend

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.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

I am using cassandra offical python library.

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 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.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

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.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Featured Posts