Documentation ¶
Index ¶
- func SetGlobalMeterProvider(mp metric.MeterProvider)
- type MeterProviderOption
- func WithAggregatorSelector(aggregatorSelector metricsdk.AggregatorSelector) MeterProviderOption
- func WithCollectPeriod(collectPeriod time.Duration) MeterProviderOption
- func WithCollectTimeout(collectTimeout time.Duration) MeterProviderOption
- func WithExporter(exporter metricsdk.Exporter, shutdownExporter ShutdownExporter) MeterProviderOption
- func WithHostInstrumentation() MeterProviderOption
- func WithPushTimeout(pushTimeout time.Duration) MeterProviderOption
- func WithResource(resource *resource.Resource) MeterProviderOption
- func WithRuntimeInstrumentation(opts ...runtime.Option) MeterProviderOption
- type ShutdownExporter
- type StopMeterProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetGlobalMeterProvider ¶
func SetGlobalMeterProvider(mp metric.MeterProvider)
Types ¶
type MeterProviderOption ¶
type MeterProviderOption func(*meterProviderConfig)
MeterProviderOption is the interface that applies the value to a meter provider configurations.
func WithAggregatorSelector ¶
func WithAggregatorSelector(aggregatorSelector metricsdk.AggregatorSelector) MeterProviderOption
WithAggregatorSelector sets selector of aggregator.
func WithCollectPeriod ¶
func WithCollectPeriod(collectPeriod time.Duration) MeterProviderOption
WithCollectPeriod sets CollectPeriod of a MeterProvider.
CollectPeriod is the interval between calls to Collect a checkpoint.
func WithCollectTimeout ¶
func WithCollectTimeout(collectTimeout time.Duration) MeterProviderOption
WithCollectTimeout sets CollectTimeout of a MeterProvider.
CollectTimeout is the timeout of the Context passed to Collect() and subsequently to Observer instrument callbacks.
func WithExporter ¶
func WithExporter(exporter metricsdk.Exporter, shutdownExporter ShutdownExporter) MeterProviderOption
WithExporter sets exporter and its shutdown function.
func WithHostInstrumentation ¶
func WithHostInstrumentation() MeterProviderOption
WithHostInstrumentation enables host instrumentation.
func WithPushTimeout ¶
func WithPushTimeout(pushTimeout time.Duration) MeterProviderOption
WithPushTimeout sets PushTimeout of a MeterProvider.
PushTimeout is the timeout of the Context when a exporter is configured.
func WithResource ¶
func WithResource(resource *resource.Resource) MeterProviderOption
WithResource sets the Resource of a MeterProvider.
func WithRuntimeInstrumentation ¶
func WithRuntimeInstrumentation(opts ...runtime.Option) MeterProviderOption
WithRuntimeInstrumentation enables runtime instrumentation.
type ShutdownExporter ¶
func NewOLTPExporter ¶
func NewOLTPExporter(ctx context.Context, clientOpts ...otlpmetricgrpc.Option) (metricsdk.Exporter, ShutdownExporter, error)
func NewStdoutExporter ¶
func NewStdoutExporter(opts ...stdoutmetric.Option) (metricsdk.Exporter, ShutdownExporter, error)
type StopMeterProvider ¶
StopMeterProvider is the type for stop function of meter provider. It stops both meter provider and exporter.
func NewMeterProvider ¶
func NewMeterProvider(opts ...MeterProviderOption) (metric.MeterProvider, StopMeterProvider, error)
NewMeterProvider creates a new meter provider and its stop function.