Closed Giaco9 closed 10 months ago
@Giaco9 thanks for opening this ticket. There is currently not a standard way to correlate APM and DBM for unsupported databases. To implement it, one would need to do something similar to what the psycopg integration does, instantiating a _DBM_Propagator
object and implementing a sql injector function for asyncpg. A pull request doing these things would be a welcome contribution for anyone who's up for it.
I've added this as a feature request to our internal backlog, which means it will be considered during future prioritization rounds. Please comment or reopen if you disagree with my understanding that this is a feature request.
Hi, Thank you for your reply :) I'm going to talk with the development team if they can have a look and open a pull request to implement this
Hi @emmettbutler, we are also insterested on this feature. Can you share the priority you are managing for this task on your internal backlog?
Thanks
Any news?
Summary of problem
asyncpg is not supported for Database Monitoring. As reported in the table here, it seems that for python only psycopg2 is supported.
Which version of dd-trace-py are you using?
ddtrace==2.3.2
Which version of pip are you using?
Which libraries and their versions are you using?
pip freeze
alembic==1.6.5 asyncpg==0.22.0 ddtrace==2.3.2 fastapi==0.73.0How can we reproduce your problem?
Our application runs in docker, and the command to start the application is the following:
These are the environment variable set in the container:
What is the result that you get?
The APM works as expected, but we can't configure the tracer to correlate traces between the application and the database. The dd agent, which monitors the database, differs from the agent that monitors the application. The agent dedicated to the database is configured using docker labels. These are the labels:
For simplicity, I put here the JSON added as
com.datadoghq.ad.instances
label:Please note that we have multiple databases in the same instance, and we successfully configured other applications whose traces correlate correctly to database metrics. Those applications are based on different languages and frameworks like python (with psycopg2), golang and kotlin. For those applications, the Database Monitoring feature is working correctly.
What is the result that you expected?
I would like to understand if there is any way to correctly configure an application based on
fastapi
andasyncpg
to correlate APM data with Database monitoring data.