ydb

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

README

ydb_opentelemetry adapter

Opentelemetry traces over ydb-go-sdk events

Usage

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

...
    // 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"),
        ydbOtel.WithTraces(
            tracer,
            ydbOtel.WithDetails(trace.DetailsAll),
        ),
    )

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coordination

func Coordination(cfg *config) (t trace.Coordination)

func DatabaseSQL

func DatabaseSQL(cfg *config) (t trace.DatabaseSQL)

DatabaseSQL makes trace.DatabaseSQL with logging events from details

func Discovery

func Discovery(cfg *config) (t trace.Discovery)

func Driver

func Driver(cfg *config) (t trace.Driver)

Driver makes Driver with publishing traces

func Ratelimiter

func Ratelimiter(cfg *config) (t trace.Ratelimiter)

func Retry

func Retry(tracer otelTrace.Tracer, d Detailer) (t trace.Retry)

func Scheme

func Scheme(cfg *config) (t trace.Scheme)

func Scripting

func Scripting(cfg *config) (t trace.Scripting)

func Table

func Table(cfg *config) (t trace.Table)

Table makes table.ClientTrace with solomon metrics publishing

func WithTraces

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

Types

type Detailer added in v0.2.1

type Detailer interface {
	Details() trace.Details
}

type Option added in v0.2.1

type Option func(c *config)

func WithDetailer added in v0.2.1

func WithDetailer(d Detailer) Option

func WithDetails added in v0.2.1

func WithDetails(d trace.Details) Option

func WithTracer added in v0.2.1

func WithTracer(tracer otelTrace.Tracer) Option

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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