ydb

package module
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

tracing

tracing package helps to create ydb-go-sdk opentracing traces

Usage

import (
    "github.com/ydb-platform/ydb-go-sdk/v3"
    "github.com/ydb-platform/ydb-go-sdk/v3/trace"
    ydbOpentracing "github.com/ydb-platform/ydb-go-sdk-opentracing"
    jaegerConfig "github.com/uber/jaeger-client-go/config"
)

...
    // init jaeger client
    tracer, closer, err := jaegerConfig.Configuration{
        ServiceName: serviceName,
        Sampler: &jaegerConfig.SamplerConfig{
            Type:  "const",
            Param: 1,
        },
        Reporter: &jaegerConfig.ReporterConfig{
            LogSpans:            true,
            BufferFlushInterval: 1 * time.Second,
            LocalAgentHostPort:  tracerURL,
        },
    }.NewTracer()
    if err != nil {
        panic(err)
    }

    db, err := ydb.Open(
        ctx,
        os.Getenv("YDB_CONNECTION_STRING"),
        ydbOpentracing.WithTraces(trace.DetailsAll),
    )

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithTraces added in v0.1.0

func WithTraces(opts ...Option) ydb.Option

Types

type Option added in v0.14.0

type Option func(c *adapter)

func WithDetailer added in v0.14.0

func WithDetailer(d trace.Detailer) Option

func WithTracer added in v0.14.0

func WithTracer(tracer opentracing.Tracer) Option

Directories

Path Synopsis
internal
cmd/bench Module

Jump to

Keyboard shortcuts

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