OpenTelemetry SQLite3 Instrumentation¶
SQLite instrumentation supporting sqlite3, it can be enabled by
using SQLite3Instrumentor
.
Usage¶
import sqlite3
from opentelemetry import trace
from opentelemetry.trace import TracerProvider
from opentelemetry.instrumentation.sqlite3 import SQLite3Instrumentor
trace.set_tracer_provider(TracerProvider())
SQLite3Instrumentor().instrument()
cnx = sqlite3.connect('example.db')
cursor = cnx.cursor()
cursor.execute("INSERT INTO test (testField) VALUES (123)")
cursor.close()
cnx.close()
API¶
-
class
opentelemetry.instrumentation.sqlite3.
SQLite3Instrumentor
[source]¶ Bases:
opentelemetry.instrumentation.instrumentor.BaseInstrumentor