Documentation ¶
Overview ¶
This package allows you to init and enable metric in your app
Index ¶
- func GetMeterProvider() metric.MeterProvider
- func InitProvider(ctx context.Context, serviceName string, options ...ProviderOptionFunc) (func() error, error)
- func Meter(name string, opts ...metric.MeterOption) metric.Meter
- func SetMeterProvider(mp metric.MeterProvider)
- func Start(ctx context.Context, appName string, host string, port int, apiKey string, ...) (func(context.Context) error, error)
- type ProviderOptionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMeterProvider ¶
func GetMeterProvider() metric.MeterProvider
func InitProvider ¶
func SetMeterProvider ¶
func SetMeterProvider(mp metric.MeterProvider)
Types ¶
type ProviderOptionFunc ¶
type ProviderOptionFunc func(*provider) error
ProviderOptionFunc is the option function for provider
func WithGRPCMetricExporter ¶
func WithGRPCMetricExporter(ctx context.Context, options ...otlpmetricgrpc.Option) ProviderOptionFunc
WithGRPCMetricExporter allows you to send your metrics to the collector target collectorTarget is the address of the collector, e.g. "127.0.0.1:4317"
func WithWriterMetricExporter ¶
func WithWriterMetricExporter(w io.Writer) ProviderOptionFunc
WithWriterMetricExporter allows you to push all metrics to an io.Writer you can use io.Discard if you don't want to be bothered by these
Click to show internal directories.
Click to hide internal directories.