package global

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

Index

Functions

func MeterProvider

func MeterProvider() metric.Provider

MeterProvider returns the registered global meter provider. If none is registered then an instance of metric.NoopProvider is returned. Use the trace provider to create a named meter. E.g.

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

func SetMeterProvider

func SetMeterProvider(mp metric.Provider)

SetMeterProvider registers `mp` as the global meter provider.

func SetTraceProvider

func SetTraceProvider(tp trace.Provider)

SetTraceProvider registers `tp` as the global trace provider.

func TraceProvider

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")

Source Files

global.go

Version
v0.2.0
Published
Dec 3, 2019
Platform
js/wasm
Imports
3 packages
Last checked
11 minutes ago

Tools for package owners.