otel: go.opentelemetry.io/otel/api/global Index | Files | Directories

package global

import "go.opentelemetry.io/otel/api/global"


Package Files


func MeterProvider Uses

func MeterProvider() metric.Provider

MeterProvider returns the registered global meter provider. If none is registered then a default meter provider is returned that forwards the Meter interface to the first registered Meter.

Use the meter provider to create a named meter. E.g.

meter := global.MeterProvider().Meter("example.com/foo")

func SetMeterProvider Uses

func SetMeterProvider(mp metric.Provider)

SetMeterProvider registers `mp` as the global meter provider.

func SetTraceProvider Uses

func SetTraceProvider(tp trace.Provider)

SetTraceProvider registers `tp` as the global trace provider.

func TraceProvider Uses

func TraceProvider() trace.Provider

TraceProvider returns the registered global trace provider. If none is registered then an instance of trace.NoopProvider is returned.

Use the trace provider to create a named tracer. E.g.

tracer := global.TraceProvider().Tracer("example.com/foo")



Package global imports 3 packages (graph) and is imported by 14 packages. Updated 2020-02-21. Refresh now. Tools for package owners.