v1

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

v1 provides a client to connect with the loggregtor v1 API

Loggregator's v1 client library is better known to the Cloud Foundry community as Dropsonde (github.com/cloudfoundry/dropsonde). The code here wraps that library in the interest of consolidating all client code into a single library which includes both v1 and v2 clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents an emitter into loggregator. It should be created with the NewClient constructor.

func NewClient

func NewClient(opts ...ClientOption) (*Client, error)

NewClient creates a v1 loggregator client. This is a wrapper around the dropsonde package that will write envelopes to loggregator over UDP. Before calling NewClient you should call dropsonde.Initialize.

func (*Client) EmitCounter

func (c *Client) EmitCounter(name string, opts ...loggregator.EmitCounterOption)

EmitCounter sends a counter envelope with a delta of 1.

func (*Client) EmitGauge

func (c *Client) EmitGauge(opts ...loggregator.EmitGaugeOption)

EmitGauge sends the configured gauge values to loggregator. If no EmitGaugeOption values are present, no envelopes will be emitted.

func (*Client) EmitLog

func (c *Client) EmitLog(message string, opts ...loggregator.EmitLogOption)

EmitLog sends a message to loggregator.

func (*Client) IncrementCounter

func (c *Client) IncrementCounter(name string) error

func (*Client) IncrementCounterWithDelta

func (c *Client) IncrementCounterWithDelta(name string, value uint64) error

func (*Client) Send

func (c *Client) Send() error

func (*Client) SendAppErrorLog

func (c *Client) SendAppErrorLog(appID, message, sourceType, sourceInstance string) error

func (*Client) SendAppLog

func (c *Client) SendAppLog(appID, message, sourceType, sourceInstance string) error

func (*Client) SendAppMetrics

func (c *Client) SendAppMetrics(m *events.ContainerMetric) error

func (*Client) SendBytesPerSecond

func (c *Client) SendBytesPerSecond(name string, value float64) error

func (*Client) SendComponentMetric

func (c *Client) SendComponentMetric(name string, value float64, unit string) error

func (*Client) SendDuration

func (c *Client) SendDuration(name string, duration time.Duration) error

func (*Client) SendMebiBytes

func (c *Client) SendMebiBytes(name string, mebibytes int) error

func (*Client) SendMetric

func (c *Client) SendMetric(name string, value int) error

func (*Client) SendRequestsPerSecond

func (c *Client) SendRequestsPerSecond(name string, value float64) error

type ClientOption

type ClientOption func(*Client)

func WithDecimalTag

func WithDecimalTag(name string, value float64) ClientOption

WithDecimalTag allows for the configuration of arbitrary decimal value metadata which will be included in all data sent to Loggregator

func WithIntegerTag

func WithIntegerTag(name string, value int64) ClientOption

WithIntegerTag allows for the configuration of arbitrary integer value metadata which will be included in all data sent to Loggregator

func WithLogger

func WithLogger(l loggregator.Logger) ClientOption

WithLogger allows for the configuration of a logger. By default, the logger is disabled.

func WithStringTag

func WithStringTag(name, value string) ClientOption

WithStringTag allows for the configuration of arbitrary string value metadata which will be included in all data sent to Loggregator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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