sdkotel

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Unlicense Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Attribute attr
	Attr      attr
	Code      code
)

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*zerolog.Logger
	Log    *log.Logger
	Logrus *logrus.Logger
}

func Log

func Log(ctx context.Context, c ...io.Writer) *Logger

func (*Logger) Context

func (l *Logger) Context(ctx context.Context) context.Context

func (*Logger) ParseLevel

func (x *Logger) ParseLevel(level string) (zerolog.Level, logrus.Level)

type Meter

type Meter struct {
	metric.Meter
	// contains filtered or unexported fields
}

func MetricMeter added in v0.6.2

func MetricMeter(ctx context.Context, c ...*MeterConfiguration) *Meter

func (*Meter) WithContext

func (m *Meter) WithContext(ctx context.Context) context.Context

type MeterConfiguration

type MeterConfiguration struct {
	Name string
	OTLP struct {
		ServiceNameKey         string
		ServiceVersionKey      string
		TelemetrySDKVersionKey string
		InstrumentationName    string
		CollectPeriod          time.Duration
		GRPC                   struct {
			URL     string
			Timeout time.Duration
		}
		HTTP struct {
			URL     string
			Timeout time.Duration
		}
	}
}

type MetricConfiguration added in v0.6.2

type MetricConfiguration struct {
	MetricName        string
	MetricDescription string
}

func (MetricConfiguration) MetricCounter added in v0.6.2

func (cfg MetricConfiguration) MetricCounter(ctx context.Context, m *Meter) (syncint64.Counter, error)

type Tracer

type Tracer struct {
	trace.Tracer
	// contains filtered or unexported fields
}

func Trace

func Trace(ctx context.Context, c ...*TracerConfiguration) *Tracer

func (Tracer) ForceFlush

func (x Tracer) ForceFlush(ctx context.Context) error

func (Tracer) RegisterSpanProcessor

func (x Tracer) RegisterSpanProcessor(s sdk_trace.SpanProcessor)

func (Tracer) Shutdown

func (x Tracer) Shutdown(ctx context.Context) error

func (Tracer) UnregisterSpanProcessor

func (x Tracer) UnregisterSpanProcessor(s sdk_trace.SpanProcessor)

func (*Tracer) WithContext

func (t *Tracer) WithContext(ctx context.Context) context.Context

type TracerConfiguration

type TracerConfiguration struct {
	Name   string
	Jaeger struct{ URL string }
	OTLP   struct {
		GRPC struct {
			Compression        string
			Endpoint           string
			Headers            map[string]string
			ReconnectionPeriod time.Duration
			Retry              struct {
				// Enabled indicates whether to not retry sending batches in case of
				// export failure.
				Enabled bool
				// InitialInterval the time to wait after the first failure before
				// retrying.
				InitialInterval time.Duration
				// MaxInterval is the upper bound on backoff interval. Once this value is
				// reached the delay between consecutive retries will always be
				// `MaxInterval`.
				MaxInterval time.Duration
				// MaxElapsedTime is the maximum amount of time (including retries) spent
				// trying to send a request/batch.  Once this value is reached, the data
				// is discarded.
				MaxElapsedTime time.Duration
			}
			// Timeout sets the max amount of time a client will attempt to export a
			// batch of spans. This takes precedence over any retry settings defined with
			// WithRetry, once this time limit has been reached the export is abandoned
			// and the batch of spans is dropped.
			//
			// If unset, the default timeout will be set to 10 seconds.
			Timeout time.Duration
		}
		HTTP struct {
			Compression string
			Endpoint    string
			Headers     map[string]string
			Retry       struct {
				// Enabled indicates whether to not retry sending batches in case of
				// export failure.
				Enabled bool
				// InitialInterval the time to wait after the first failure before
				// retrying.
				InitialInterval time.Duration
				// MaxInterval is the upper bound on backoff interval. Once this value is
				// reached the delay between consecutive retries will always be
				// `MaxInterval`.
				MaxInterval time.Duration
				// MaxElapsedTime is the maximum amount of time (including retries) spent
				// trying to send a request/batch.  Once this value is reached, the data
				// is discarded.
				MaxElapsedTime time.Duration
			}
			// Timeout tells the driver the max waiting time for the backend to process
			// each spans batch.  If unset, the default will be 10 seconds.
			Timeout time.Duration

			// URLPath allows one to override the default URL path used
			// for sending traces. If unset, default ("/v1/traces") will be used.
			URLPath string
		}
	}
}

Jump to

Keyboard shortcuts

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