nrdgraph

package module
v0.0.0-...-64649ce Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: MIT Imports: 4 Imported by: 0

README

nrdgraph

GoDoc license

Dgraph client instrumentation for New Relic.

Example

addrs := []string{
	"dgraph-1.example.com",
	"dgraph-2.example.com",
	"dgraph-3.example.com",
}

clients := make([]api.DgraphClient, len(addrs), len(addrs))

for i, addr := range addrs {
	conn, _ := grpc.Dial(addr, grpc.WithInsecure())
	clients[i] = nrdgraph.Wrap(api.NewDgraphClient(d), nrdgraph.WithHost(addr))
}

client := dgo.NewDgraphClient(clients...)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(dc api.DgraphClient, opts ...Option) api.DgraphClient

Wrap creates wraps the DgraphClient to spport to creating newrelic segments on each requests.

Types

type Option

type Option func(*options)

func WithDatabaseName

func WithDatabaseName(name string) Option

WithHost sets database name to newrelic segment.

func WithHost

func WithHost(host string) Option

WithHost sets host name to newrelic segment.

func WithID

func WithID(id string) Option

WithHost sets ID to newrelic segment.

Jump to

Keyboard shortcuts

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