Skip to content

dgraph-io/dgdao-telemetry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dgdao-telemetry

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.

Install

go get github.com/dgraph-io/dgdao-telemetry

Usage

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.

Related projects

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

License

Apache-2.0. See LICENSE and NOTICE.

About

OpenTelemetry instrumentation for Dgraph clients (dgraph-io/dgdao); formerly mlwelles/modusGraph-telemetry

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages