Documentation
¶
Overview ¶
Package metermod provides OpenTelemetry meter provider as a module.
Index ¶
Examples ¶
Constants ¶
const ( ErrMissingProvider = errStr("meter provider not set") ErrFlushFailed = errStr("failed to flush remaining metrics") )
const ID = "metermod"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opt ¶
func WithEnv ¶ added in v0.1.5
func WithEnv() Opt
WithEnv uses OTEL_EXPORTER_OTLP_TRACES_PROTO and OTEL_EXPORTER_OTLP_PROTO environment variable to set exporter. Accepted values are:
- http
- grpc
- stdout
If no value is provided, stdout is used.
func WithGRPC ¶
func WithGRPC() Opt
WithGRPC creates meter provider with periodic reader using grpc exporter from OTEL_* env configs. Env variables: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc
func WithHTTP ¶
func WithHTTP() Opt
WithHTTP creates meter provider with periodic reader using http exporter from OTEL_* env configs. Env variables: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp
func WithProvider ¶
func WithProvider(exp *metric.MeterProvider) Opt
WithProvider sets the underlying meter provider for module.
func WithProviderFn ¶
func WithProviderFn(fn func() (*metric.MeterProvider, error)) Opt
WithProviderFn sets the underlying meter provider for module using given function.
func WithRuntimeMetrics ¶ added in v0.1.2
WithRuntimeMetrics starts runtime metrics collection.
func WithStdout ¶ added in v0.1.5
func WithStdout(opt ...stdoutmetric.Option) Opt
WithStdout creates meter provider with stdout exporter.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}