{"repo":"XSAM/otelsql","free":true,"listed":false,"github":"https://github.com/XSAM/otelsql","clone":"git clone https://github.com/XSAM/otelsql.git","description":"OpenTelemetry instrumentation for database/sql","language":"Go","stars":421,"topics":["opentelemetry","golang","instrumentation","sql"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"otelsql It is an OpenTelemetry instrumentation for Golang database/sql , a port from https://github.com/open-telemetry/opentelemetry-go-contrib/pull/505. It instruments traces and metrics. Install Usage This project provides four different ways to instrument database/sql : otelsql.Open , otelsql.OpenDB , otesql.Register and otelsql.WrapDriver . And then use otelsql.RegisterDBStatsMetrics to instrument sql.DBStats with metrics. Check Option for more features like adding context propagation to SQL queries when enabling WithSQLCommenter . See godoc for details. Blog Getting started with otelsql, the OpenTelemetry instrumentation for Go SQL, is a blog post that explains how to use otelsql in miutes. Examples This project provides two docker-compose examples to show how to use it. - The stdout example is a simple example to show how to use it with a MySQL database. It prints the trace data to stdout and serves metrics data via prometheus client. - The otel-collector example is a more complex example to show how to use it with a MySQL database and an OpenTelemetry Collector. It sends the trace data and metrics data to an OpenTelemetry Collector. Then, it shows data visually on Jaeger and Prometheus servers. Trace Instruments It creates spans on corresponding methods. Use SpanOptions to adjust creation of spans. Metric Instruments - db.client.operation.duration : Duration of database client operations - Unit: seconds - Attributes: db.operation.name (method name), error.type (if erro","default_branch":null,"files":null,"tree":[],"storefront":"/r/XSAM","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/XSAM/otelsql/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}