expvar

package
v2.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpvarForwarder

type ExpvarForwarder struct {
	// contains filtered or unexported fields
}

ExpvarForwarder reads from an expvar and write them to the Loggregator Agent.

func NewExpvarForwarder

func NewExpvarForwarder(agentAddr string, opts ...ExpvarForwarderOption) *ExpvarForwarder

NewExpvarForwarder returns a new ExpvarForwarder.

func (*ExpvarForwarder) Start

func (f *ExpvarForwarder) Start()

Start starts the ExpvarForwarder. It starts reading from the given endpoints and looking for the corresponding metrics via the templates. Start blocks.

type ExpvarForwarderOption

type ExpvarForwarderOption func(*ExpvarForwarder)

ExpvarForwarderOption configures an ExpvarForwarder.

func AddExpvarCounterTemplate

func AddExpvarCounterTemplate(addr, metricName, sourceId, txtTemplate string, tags map[string]string) ExpvarForwarderOption

AddExpvarCounterTemplate returns an ExpvarForwarderOption that configures the ExpvarForwarder to look for counter metrics. Each template is a text/template. This can be called several times to add more counter metrics. There has to be atleast one counter or gauge template.

func AddExpvarGaugeTemplate

func AddExpvarGaugeTemplate(addr, metricName, metricUnit, sourceId, txtTemplate string, tags map[string]string) ExpvarForwarderOption

WithExpvarGaugeTemplates returns an ExpvarForwarderOption that configures the ExpvarForwarder to look for gauge metrics. Each template is a text/template. This can be called several times to add more counter metrics. There has to be atleast one counter or gauge template.

func AddExpvarMapTemplate

func AddExpvarMapTemplate(addr, metricName, sourceId, txtTemplate string, tags map[string]string) ExpvarForwarderOption

TODO: Put a comment here

func WithAgentDialOpts

func WithAgentDialOpts(opts ...grpc.DialOption) ExpvarForwarderOption

WithAgentDialOpts returns an ExpvarForwarderOption that configures the dial options for dialing Agent. Defaults to grpc.WithInsecure().

func WithExpvarDefaultSourceId

func WithExpvarDefaultSourceId(sourceId string) ExpvarForwarderOption

func WithExpvarGlobalTag

func WithExpvarGlobalTag(key, value string) ExpvarForwarderOption

func WithExpvarInterval

func WithExpvarInterval(i time.Duration) ExpvarForwarderOption

WithExpvarInterval returns an ExpvarForwarderOption that configures how often the ExpvarForwarder reads from the Expvar endpoints. Defaults to 1 minute.

func WithExpvarLogger

func WithExpvarLogger(l *log.Logger) ExpvarForwarderOption

WithExpvarLogger returns an ExpvarForwarderOption that configures the logger used for the ExpvarForwarder. Defaults to silent logger.

func WithExpvarStructuredLogger

func WithExpvarStructuredLogger(l *log.Logger) ExpvarForwarderOption

WithExpvarLogger returns an ExpvarForwarderOption that configures the structured logger used for the ExpvarForwarder. Defaults to silent logger. Structured logging is used to capture the values from the health endpoints.

Normally this would be dumped to stdout so that an operator can see a history of metrics.

func WithExpvarVersion

func WithExpvarVersion(version string) ExpvarForwarderOption

Jump to

Keyboard shortcuts

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