telemetry

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

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.

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.

Documentation

Overview

Package telemetry provides an OpenTelemetry-backed tracer for the dgdao typed client. The typed client traces every database operation through a pluggable typed.Tracer; install this implementation once at startup:

typed.SetTracer(telemetry.New())

With no OpenTelemetry SDK installed in the process the spans are no-ops; configuring an SDK and exporter is the application's job.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() typed.Tracer

New returns a typed.Tracer backed by the global OpenTelemetry tracer provider.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL