trace

package
v1.2.120 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Drivers

func Drivers() []string

Drivers returns a sorted list of the names of the registered drivers.

func GetScheme

func GetScheme() string

GetScheme gets the default scheme that will be used.

func NewTracerProvider

func NewTracerProvider(ctx context.Context, options ...Option) (*sdktrace.TracerProvider, error)

func Register

func Register(driver ExporterURLOpener)

Register makes a driver available by the provided name. If Register is called twice with the same name or if driver is nil, it panics.

func SetDefaultScheme

func SetDefaultScheme(scheme string)

SetDefaultScheme sets the default scheme that will be used. The default scheme is "passthrough".

NOTE: this function must only be called during initialization time (i.e. in an init() function), and is not thread-safe. The scheme set last overrides previously set values.

Types

type EmptyOption

type EmptyOption struct{}

EmptyOption does not alter the configuration. It can be embedded in another structure to build custom options.

This API is EXPERIMENTAL.

type ExporterURLOpener

type ExporterURLOpener interface {
	// OpenExporterURL creates a new exporter for the given target.
	OpenExporterURL(ctx context.Context, u *url.URL) (sdktrace.SpanExporter, error)

	// Scheme returns the scheme supported by this exporter.
	// Scheme is defined at https://github.com/grpc/grpc/blob/master/doc/naming.md.
	Scheme() string
}

ExporterURLOpener represents types that can open metric exporters based on a URL. The opener must not modify the URL argument. OpenExporterURL must be safe to call from multiple goroutines.

This interface is generally implemented by types in driver packages.

func Get

func Get(scheme string) ExporterURLOpener

Get returns the metric url opener registered with the given scheme.

If no driver is register with the scheme, nil will be returned.

type Option

type Option interface {
	// contains filtered or unexported methods
}

A Option sets options.

func WithOptionExporterEndpoints

func WithOptionExporterEndpoints(v ...string) Option

WithOptionExporterEndpoints appends ExporterEndpoints in option. ExporterEndpoints is the target endpoint URL (scheme, host, port, path) the Exporter will connect to.

func WithOptionExporterEndpointsReplace

func WithOptionExporterEndpointsReplace(v ...string) Option

WithOptionExporterEndpointsReplace sets ExporterEndpoints in option. ExporterEndpoints is the target endpoint URL (scheme, host, port, path) the Exporter will connect to.

func WithOptionExporters

func WithOptionExporters(v ...sdktrace.SpanExporter) Option

WithOptionExporters appends Exporters in option.

func WithOptionExportersReplace

func WithOptionExportersReplace(v ...sdktrace.SpanExporter) Option

WithOptionExportersReplace sets Exporters in option.

func WithOptionResourceAttrs

func WithOptionResourceAttrs(v ...attribute.KeyValue) Option

WithOptionResourceAttrs appends ResourceAttrs in option.

func WithOptionResourceAttrsReplace

func WithOptionResourceAttrsReplace(v ...attribute.KeyValue) Option

WithOptionResourceAttrsReplace sets ResourceAttrs in option.

func WithOptionSpanAttrs

func WithOptionSpanAttrs(v ...attribute.KeyValue) Option

WithOptionSpanAttrs appends SpanAttrs in option.

func WithOptionSpanAttrsReplace

func WithOptionSpanAttrsReplace(v ...attribute.KeyValue) Option

WithOptionSpanAttrsReplace sets SpanAttrs in option.

func WithOptionTracerProviderOptions

func WithOptionTracerProviderOptions(v ...sdktrace.TracerProviderOption) Option

WithOptionTracerProviderOptions appends TracerProviderOptions in option.

func WithOptionTracerProviderOptionsReplace

func WithOptionTracerProviderOptionsReplace(v ...sdktrace.TracerProviderOption) Option

WithOptionTracerProviderOptionsReplace sets TracerProviderOptions in option.

type OptionFunc

type OptionFunc func(*option)

OptionFunc wraps a function that modifies option into an implementation of the Option interface.

Directories

Path Synopsis
otlptrace

Jump to

Keyboard shortcuts

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