Documentation ¶
Index ¶
- type ExpvarForwarder
- type ExpvarForwarderOption
- func AddExpvarCounterTemplate(addr, metricName, sourceId, txtTemplate string, tags map[string]string) ExpvarForwarderOption
- func AddExpvarGaugeTemplate(addr, metricName, metricUnit, sourceId, txtTemplate string, ...) ExpvarForwarderOption
- func AddExpvarMapTemplate(addr, metricName, sourceId, txtTemplate string, tags map[string]string) ExpvarForwarderOption
- func WithExpvarDefaultSourceId(sourceId string) ExpvarForwarderOption
- func WithExpvarDialOpts(opts ...grpc.DialOption) ExpvarForwarderOption
- func WithExpvarGlobalTag(key, value string) ExpvarForwarderOption
- func WithExpvarInterval(i time.Duration) ExpvarForwarderOption
- func WithExpvarLogger(l *log.Logger) ExpvarForwarderOption
- func WithExpvarStructuredLogger(l *log.Logger) ExpvarForwarderOption
- func WithExpvarVersion(version string) ExpvarForwarderOption
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 LogCache.
func NewExpvarForwarder ¶
func NewExpvarForwarder(logCacheAddr 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 WithExpvarDefaultSourceId ¶
func WithExpvarDefaultSourceId(sourceId string) ExpvarForwarderOption
func WithExpvarDialOpts ¶
func WithExpvarDialOpts(opts ...grpc.DialOption) ExpvarForwarderOption
WithExpvarDialOpts returns an ExpvarForwarderOption that configures the dial options for dialing LogCache. Defaults to grpc.WithInsecure().
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