metric

package
v0.0.0-...-48b9d42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stop

func Stop()

Types

type Configuration

type Configuration struct {
	// AgentEndpoint is agent address of collecting trace message, host:port
	// Can be provided via environment variable named OTLP_AGENT_EDNPOINT
	AgentEndpoint string

	// Enabled can be provided via environment variable named METRIC_ENABLED
	Enabled bool
}

Configuration configures and creates Metric

func FromEnv

func FromEnv() (*Configuration, error)

FromEnv uses environment variables to set the metric's Configuration

func (*Configuration) FromEnv

func (c *Configuration) FromEnv() (*Configuration, error)

FromEnv uses environment variables and overrides existing metric's Configuration

func (*Configuration) NewMeter

func (c *Configuration) NewMeter(name string, options ...Option) (metric.Meter, error)

NewMeter create a new metric

type Option

type Option func(c *Options)

Option is a function that sets some option on the client.

func Logger

func Logger(logger *zap.Logger) Option

Logger can be provided to logger.

type Options

type Options struct {
	Logger *zap.Logger
}

Options control behavior of the client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL