A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pkg.go.dev/github.com/raito-io/neo4j-tracing below:

neo4j_tracing package - github.com/raito-io/neo4j-tracing - Go Packages

RAITO - Neo4J Tracing

Introduction

neo4jtracing is a go library that enables otel distribute tracing for neo4j driver v5.

Getting Started

Add this library as a dependency via go get github.com/raito-io/neo4j-tracing

Enable tracing

Tracing can be enabled by using the neo4j_tracing.Neo4jTracer object. The Neo4jTracer a factory that creates neo4j.DriverWithContext objects that are wrapped so distributed tracing can be applied.

Start using tracing is very easy. A regular neo4j driver will be created as follows:

package main

import (
	"github.com/neo4j/neo4j-go-driver/v5/neo4j"
)

func main() {
    dbUri := "neo4j://localhost" // scheme://host(:port) (default port is 7687)
    driver, err := neo4j.NewDriverWithContext(dbUri, neo4j.BasicAuth("neo4j", "letmein!", ""))
    if err != nil {
        panic(err)
    }
    // Do something useful
}

To enable tracing you need to create your driver by using the Neo4jTracer object.

package main

import (
    "github.com/neo4j/neo4j-go-driver/v5/neo4j"
    neo4j_tracing "github.com/raito-io/neo4j-tracing"
)

func main() {
    driverFactory := neo4j_tracing.NewNeo4jTracer()
	
    dbUri := "neo4j://localhost" // scheme://host(:port) (default port is 7687)
    driver, err := driverFactory.NewDriverWithContext(dbUri, neo4j.BasicAuth("neo4j", "letmein!", ""))
    if err != nil {
        panic(err)
    }
    // Do something useful
}
Options

The following options could be used to customize the tracing behavior:

Those options are passed as argument to the neo4j_tracing.NewNeo4jTracer() function.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4