autometer

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package autometer provides an OpenTelemetry MeterProvider creation function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LookupExporter added in v0.15.2

type LookupExporter func(ctx context.Context, name string) (sdkmetric.Reader, bool, error)

LookupExporter creates exporter by name.

type Option

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

Option applies a configuration option value to a MeterProvider.

func WithLookupExporter added in v0.15.2

func WithLookupExporter(lookup LookupExporter) Option

WithLookupExporter sets exporter lookup function.

func WithOnPrometheusRegistry

func WithOnPrometheusRegistry(f func(reg *prometheus.Registry)) Option

func WithPrometheusRegisterer

func WithPrometheusRegisterer(reg prometheus.Registerer) Option

func WithResource

func WithResource(res *resource.Resource) Option

WithResource associates a Resource with a MeterProvider. This Resource represents the entity producing telemetry and is associated with all Meters the MeterProvider will create.

By default, if this Option is not used, the default Resource from the go.opentelemetry.io/otel/sdk/resource package will be used.

func WithWriter added in v0.7.1

func WithWriter(out io.Writer) Option

WithWriter sets writer for the stderr, stdout exporters.

type ShutdownFunc

type ShutdownFunc func(ctx context.Context) error

ShutdownFunc is a function that shuts down the MeterProvider.

func NewMeterProvider

func NewMeterProvider(ctx context.Context, options ...Option) (
	meterProvider metric.MeterProvider,
	meterShutdown ShutdownFunc,
	err error,
)

NewMeterProvider returns new metric.MeterProvider based on environment variables.

Jump to

Keyboard shortcuts

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