metrics_pool

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyMetricsEmitterPool

type DummyMetricsEmitterPool struct{}

func (DummyMetricsEmitterPool) GetDefaultMetricsEmitter

func (d DummyMetricsEmitterPool) GetDefaultMetricsEmitter() metrics.MetricEmitter

func (DummyMetricsEmitterPool) GetMetricsEmitter

func (d DummyMetricsEmitterPool) GetMetricsEmitter(_ interface{}) (metrics.MetricEmitter, error)

func (DummyMetricsEmitterPool) Run

func (DummyMetricsEmitterPool) SetDefaultMetricsEmitter

func (d DummyMetricsEmitterPool) SetDefaultMetricsEmitter(_ metrics.MetricEmitter)

type MetricsEmitterPool

type MetricsEmitterPool interface {
	// GetDefaultMetricsEmitter returns the default metrics.MetricEmitter
	// that should be handled by this mux; while SetDefaultMetricsEmitter
	// provides a way to set the default metrics.MetricEmitter
	GetDefaultMetricsEmitter() metrics.MetricEmitter
	SetDefaultMetricsEmitter(metricEmitter metrics.MetricEmitter)

	// GetMetricsEmitter returns the specific metrics.MetricEmitter.
	// the parameters are used for certain pool implementation to parse request info.
	// we will always try to get emitter from local cache, and creating one if not exist.
	GetMetricsEmitter(parameters interface{}) (metrics.MetricEmitter, error)

	// Run starts the syncing logic of emitter pool implementations
	Run(ctx context.Context)
}

MetricsEmitterPool is a metrics emitter pool for metrics emitter. it stores all the emitter implementations, and provide a getter function to acquire them. this thought is much like the thread pool.

func NewCustomMetricsEmitterPool

func NewCustomMetricsEmitterPool(emitterPool MetricsEmitterPool) MetricsEmitterPool

func NewOpenTelemetryPrometheusMetricsEmitterPool

func NewOpenTelemetryPrometheusMetricsEmitterPool(genericConf *generic.MetricsConfiguration, mux *http.ServeMux) (MetricsEmitterPool, error)

type PrometheusMetricOptions

type PrometheusMetricOptions struct {
	Path metrics.PrometheusMetricPathName
}

Jump to

Keyboard shortcuts

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