telemetry

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resources

func Resources(ctx context.Context, service, version string) *resource.Resource

func Setup

func Setup(ctx context.Context, service, version string, options ...Variadic) (shutdown func(context.Context) error, err error)

Setup bootstraps the OpenTelemetry pipeline. If it does not return an error, make sure to call shutdown for proper cleanup.

Types

type ETHR added in v2.2.6

type ETHR struct {
	Client *http.Client

	Headers map[string]string
}

func Client added in v2.2.6

func Client(headers map[string]string) *ETHR

func (*ETHR) Do added in v2.2.6

func (c *ETHR) Do(r *http.Request) (*http.Response, error)

type Logs

type Logs struct {
	// Logs represents [otlploghttp.Option] configurations.
	//
	// Defaults:
	//
	// 	- otlploghttp.WithInsecure()
	// 	- otlploghttp.WithEndpoint("http://zipkin.istio-system.svc.cluster.local:9411")
	Options []otlploghttp.Option

	// Debugger configures an additional [stdoutlog.Exporter] if not nil. Defaults nil.
	Debugger *stdoutlog.Exporter

	// Local will prevent an external log exporter from getting used as a processor. If true, forces [Logs.Debugger] configuration. Default is false.
	Local bool
}

type Metrics

type Metrics struct {
	// Options represents [otlpmetrichttp.Option] configurations.
	//
	// Defaults:
	//
	// 	- otlpmetrichttp.WithInsecure()
	//	- otlpmetrichttp.WithEndpoint("opentelemetry-collector.observability.svc.cluster.local:4318")
	Options []otlpmetrichttp.Option

	// Debugger configures an additional [metric.Exporter] if not nil. Defaults nil.
	Debugger metric.Exporter

	// Local will prevent an external metrics provider from getting used. If true, forces [Metrics.Debugger] configuration. Default is false.
	Local bool
}

type Settings

type Settings struct {
	// Zipkin represents a zipkin collector.
	Zipkin *Zipkin

	// Tracer represents [otlptracehttp.Option] configurations.
	Tracer *Tracer

	// Metrics represents [otlpmetrichttp.Option] configurations.
	Metrics *Metrics

	// Logs represents [otlploghttp.Option] configurations.
	Logs *Logs

	// Propagators ...
	//
	// Defaults:
	//
	//	- [propagation.TraceContext]
	//	- [propagation.Baggage]
	Propagators []propagation.TextMapPropagator
}

func Options

func Options() *Settings

type Tracer

type Tracer struct {
	// Options represents [otlptracehttp.Option] configurations.
	//
	// Defaults:
	//
	// 	- otlptracehttp.WithInsecure()
	// 	- otlptracehttp.WithEndpoint("opentelemetry-collector.observability.svc.cluster.local:4318")
	Options []otlptracehttp.Option

	// Debugger configures an additional [stdouttrace.Exporter] if not nil. Defaults nil.
	Debugger *stdouttrace.Exporter

	// Local will prevent an external tracer from getting used as a provider. If true, forces [Tracer.Debugger] configuration. Default is false.
	Local bool
}

type Variadic

type Variadic func(options *Settings)

type Zipkin

type Zipkin struct {
	// URL - Zipkin collector url - defaults to "http://opentelemetry-collector.observability.svc.cluster.local:9441".
	URL string

	// Enabled will enable the Zipkin collector. Default is true.
	Enabled bool
}

Jump to

Keyboard shortcuts

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