Open ankitnayan opened 2 years ago
This is available not as Django ORM instrumentation but for the particular underlying database driver. For instance opentelemetry-instrumentation-psycopg2
for Postgres, opentelemetry-instrumentation-pymysql
for MySQL, the SQLite one you already mentioned, etc.
For postgres specifically you might run into https://github.com/open-telemetry/opentelemetry-python-contrib/issues/610 if you are using psycopg2-binary
.
We have instrumentation for individual DB drivers like @phillipuniverse said but I don't see why we the existing Django instrumentation cannot cover the ORM as well. Might be useful to have for additional insight or use with DB backends we don't have instrumentation for.
We have instrumentation for individual DB drivers like @phillipuniverse said but I don't see why we the existing Django instrumentation cannot cover the ORM as well. Might be useful to have for additional insight or use with DB backends we don't have instrumentation for.
Right, and I think django ORM is heavily used by teams working on django. Not having db spans in trace will leave a huge gap on instrumentation.
Is this an issue to track the addition of ORM auto-instrumentation support in Django? If so, please update the description and title, @ankitnayan :v:
auto-instrumentation already supports django orm (django version == 4.2.2), at least works for me
@tylerstar could you elaborate? Is there any other settings you needed to enable? Which version of the auto instumenter were you using etc? I can't see in the django instrumentor code where this would get hooked into the ORM. And im only seeing request level spans come through from my django 4.2 app.
Is it by enabling the sql_commentor flag? I wasnt super sure what that did?
Does opentelemetry auto-instrument Django ORM database calls? Since, most of the Django users use the in-built ORM, it would be very useful to extend DB instrumentation to ORM. When I run
opentelemetry-bootstrap
, I can seeopentelemetry-instrumentation-sqlite3
as one of the values, so opentelemetry should be auto-instrumenting DB calls made.