metrics

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

metrics implements a metrics reporter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Prometheus represents a Prometheus metrics exporter configuration.
	Prometheus *prometheus.Config `yaml:"prometheus"`

	// FlushInterval represents the time interval in seconds at which to flush metrics to the internal registry.
	FlushInterval int `yaml:"flush_interval"`

	// WithRuntimeMetrics represents a flag indicating whether Go runtime metrics should be included to the registered
	// metrics.
	WithRuntimeMetrics bool `yaml:"runtime_metrics"`

	// Debug represents a flags indicating whether to enable internal reporter activity logging.
	// This is mainly for debug purposes.
	Debug bool `yaml:"debug"`
}

Config represents a metrics reporter configuration.

type Reporter

type Reporter struct {
	Prometheus *prometheus.Exporter

	*debug.D
	// contains filtered or unexported fields
}

Reporter represents a metrics reporter instance.

func New

func New(config *Config) (*Reporter, error)

New returns a new metrics reporter instance.

func (*Reporter) Register

func (r *Reporter) Register(name string, metric interface{}) error

Register registers a metric in the internal registry.

func (*Reporter) Start

func (r *Reporter) Start(ctx context.Context) error

Start starts the metrics reporter.

func (*Reporter) Stop

func (r *Reporter) Stop(ctx context.Context) error

Stop stops the metrics reporter.

Directories

Path Synopsis
prometheus implements a Prometheus-compatible metrics exporter.
prometheus implements a Prometheus-compatible metrics exporter.

Jump to

Keyboard shortcuts

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