Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Latest commit

 

History

History
26 lines (17 loc) · 736 Bytes

File metadata and controls

26 lines (17 loc) · 736 Bytes

OpenTelemetry Database API integration

The trace integration with Database API supports libraries following the specification.

Usage

import mysql.connector
from opentelemetry.trace import tracer_provider
from opentelemetry.ext.dbapi import trace_integration

trace.set_preferred_tracer_provider_implementation(lambda T: TracerProvider())
tracer = trace.get_tracer(__name__)
# Ex: mysql.connector
trace_integration(tracer_provider(), mysql.connector, "connect", "mysql")

References