otel

package
v0.0.0-...-860e413 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapToKeyValue

func MapToKeyValue(labels map[string]attribute.Value) []attribute.KeyValue

func NewMetrics

func NewMetrics(meterName string) (metrics.Metrics, error)

func NewTracerFromConfig

func NewTracerFromConfig(rawConfig map[string]interface{}) (err error)

Types

type Config

type Config struct {
	MeterName string
}

func (*Config) NewMetrics

func (c *Config) NewMetrics() (err error)

type Metrics

type Metrics struct {
	Exporter          *prometheus.Exporter
	Meter             metric.Meter
	Counters          sync.Map
	UpDownSumObserver sync.Map
	ValueObservers    sync.Map
}

func (*Metrics) AddCount

func (m *Metrics) AddCount(ctx context.Context, name string, value int64, labels map[string]attribute.Value) error

func (*Metrics) GetExporter

func (m *Metrics) GetExporter() http.Handler

func (*Metrics) GetMetricsProvider

func (m *Metrics) GetMetricsProvider() metric.MeterProvider

func (*Metrics) RegisterCounter

func (m *Metrics) RegisterCounter(name, description string) error

func (*Metrics) RegisterUpDownSumObserver

func (m *Metrics) RegisterUpDownSumObserver(name, description string, callbackFunc metric.Int64ObserverFunc) error

func (*Metrics) RegisterValueObserver

func (m *Metrics) RegisterValueObserver(name, description string, callbackFunc metric.Int64ObserverFunc) error

Jump to

Keyboard shortcuts

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