An OpenTelemetry-backed tracer for the
dgdao typed client. The typed
client traces every database operation through a pluggable typed.Tracer (a no-op by
default); this package provides the OpenTelemetry implementation.
go get github.com/dgraph-io/dgdao-telemetry
Install the tracer once at startup, after configuring your OpenTelemetry SDK and exporter:
import (
"github.com/dgraph-io/dgdao/typed"
telemetry "github.com/dgraph-io/dgdao-telemetry"
)
func main() {
// ... configure your OpenTelemetry SDK / exporter ...
typed.SetTracer(telemetry.New())
}Each typed database operation then emits a dgdao.<op> client span carrying the
Dgraph database semantic attributes db.system=dgraph, db.operation.name, and
db.collection.name. With no SDK installed in the process the spans are no-ops.
Part of the dgdao family:
- dgdao — core typed client and DAO library for Dgraph
- dgdao-gen — code generator and wrapper-entity runtime
- dgdao-migrate — struct-first schema migration framework for Dgraph