otel

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package otel provides customization for OpenTelemetry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Runners added in v0.3.0

func Runners(opts ...Option) []func(context.Context) error

Runners provides customized runners for OpenTelemetry collectors.

func TraceSample

func TraceSample(ctx context.Context) bool

TraceSample returns a Sampler that samples log according to trace sampling.

Types

type Option

type Option func(*options)

Option configures OpenTelemetry.

func WithMetric

func WithMetric(opts ...controller.Option) Option

WithMetric enables OpenTelemetry metric collection.

See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md.

This is an EXPERIMENTAL API and may be changed or removed in the future.

func WithMetricDistribution

func WithMetricDistribution(distribution export.AggregatorSelector) Option

WithMetricDistribution configures the distribution aggregator of OpenTelemetry metric collection.

This is an EXPERIMENTAL API and may be changed or removed in the future.

func WithMetricExporter

func WithMetricExporter(exporter func(context.Context) (export.Exporter, func(), error)) Option

WithMetricExporter enables OpenTelemetry metric collection with provided metric exporter.

This is an EXPERIMENTAL API and may be changed or removed in the future.

func WithOTLPMetricExporter added in v0.4.0

func WithOTLPMetricExporter(opts ...otlpmetricgrpc.Option) Option

WithOTLPMetricExporter starts OpenTelemetry meter with OpenTelemetry Collector.

func WithOTLPTraceExporter added in v0.4.0

func WithOTLPTraceExporter(opts ...otlptracegrpc.Option) Option

WithOTLPTraceExporter starts OpenTelemetry trace with OpenTelemetry Collector.

func WithResource

func WithResource(opts ...resource.Option) Option

WithResource configures telemetry Resource.

func WithRuntimeMetric

func WithRuntimeMetric(opts ...runtime.Option) Option

WithRuntimeMetric enables collection of runtime metrics.

See https://opentelemetry.io/registry/instrumentation-go-runtime/.

func WithService

func WithService(name string) Option

WithService provides service name to use instead of the one parse from build info or executable name.

func WithTraceExporter

func WithTraceExporter(
	exporter func(context.Context) (sdk.SpanExporter, error),
	batchOpts ...sdk.BatchSpanProcessorOption,
) Option

WithTraceExporter enables OpenTelemetry trace collection with provided trace exporter.

func WithVersion added in v0.3.0

func WithVersion(version string) Option

WithVersion provides service version to use instead of the one parse from build info.

Jump to

Keyboard shortcuts

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