Hi !
I want to integrate OpenTelemetry in a large project that use a postgresql database.
If I setup the psycopg2 integration like this in a tracing.py module...
from opentelemetry import trace
from opentelemetry.ext import psycopg2
from opentelemetry.sdk.trace import TracerProvider
trace.set_tracer_provider(TracerProvider())
psycopg2.trace_integration()
... then I "magically" got spans emitted for every single database request made in project.
But I do not want a span for each request. In fact there is few requests that are valuables among all of them. I want to save few cpu, networks, logs and storage by avoiding to emit spans for most of these requests.
Can I still use opentelemtry psycopg2 integration ?
Should I use the start_as_current_span context for the few requests that I'm interested in ? If so, can I retrieve the attributes that were added in the span by the psycopg2 integration, i.e. can I re-use the psycopg2 integration subpackage ?
Many thanks.
Hi !
I want to integrate OpenTelemetry in a large project that use a postgresql database.
If I setup the psycopg2 integration like this in a tracing.py module...
... then I "magically" got spans emitted for every single database request made in project.
But I do not want a span for each request. In fact there is few requests that are valuables among all of them. I want to save few cpu, networks, logs and storage by avoiding to emit spans for most of these requests.
Can I still use opentelemtry psycopg2 integration ?
Should I use the
start_as_current_spancontext for the few requests that I'm interested in ? If so, can I retrieve the attributes that were added in the span by the psycopg2 integration, i.e. can I re-use the psycopg2 integration subpackage ?Many thanks.