{"id":65312,"library":"xsam-otelsql","title":"OTel SQL","description":"Package otelsql instruments the database/sql package.","status":"active","version":"0.42.0","language":"go","source_language":null,"source_url":"https://github.com/XSAM/otelsql","tags":["opentelemetry","sql","database","instrumentation","observability"],"install":[{"cmd":"go get github.com/XSAM/otelsql","lang":"bash","label":"Install github.com/XSAM/otelsql"}],"dependencies":[],"imports":[{"symbol":"otelsql","correct":"github.com/XSAM/otelsql"}],"quickstart":{"code":"package main\n\nimport (\n\t\"database/sql\"\n\t\"github.com/XSAM/otelsql\"\n\t\"go.opentelemetry.io/otel\"\n)\n\nfunc main() {\n\tdb, _ := sql.Open(\"mysql\", \"user:pass@/dbname\")\n\tdb = otelsql.OpenDB(\"mysql\", \"user:pass@/dbname\", otelsql.WithTracerProvider(otel.GetTracerProvider()))\n\tdefer db.Close()\n}","lang":"go","description":"Wraps a database/sql connection with OpenTelemetry instrumentation."},"warnings":[{"fix":"Ensure you have imported and configured an OTel exporter and provider.","message":"Requires an OpenTelemetry SDK to be configured for tracing to work.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'databas':11 'database/sql':7 'instrument':5,12 'observ':13 'opentelemetri':9 'otel':1 'otelsql':4 'packag':3,8 'sql':2,10","created_at":"2026-06-17T17:08:31.284897+00:00","updated_at":"2026-06-17T17:08:31.284897+00:00","problems":[],"ecosystem":"go","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/XSAM/otelsql","github":"https://github.com/XSAM/otelsql","docs":"https://pkg.go.dev/github.com/XSAM/otelsql#section-documentation","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["observability","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-12-14","install_tag":null}}