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 ¶
- type Client
- func (c *Client) EmitCounter(name string, opts ...loggregator.EmitCounterOption)
- func (c *Client) EmitGauge(opts ...loggregator.EmitGaugeOption)
- func (c *Client) EmitLog(message string, opts ...loggregator.EmitLogOption)
- func (c *Client) IncrementCounter(name string) error
- func (c *Client) IncrementCounterWithDelta(name string, value uint64) error
- func (c *Client) Send() error
- func (c *Client) SendAppErrorLog(appID, message, sourceType, sourceInstance string) error
- func (c *Client) SendAppLog(appID, message, sourceType, sourceInstance string) error
- func (c *Client) SendAppMetrics(m *events.ContainerMetric) error
- func (c *Client) SendBytesPerSecond(name string, value float64) error
- func (c *Client) SendComponentMetric(name string, value float64, unit string) error
- func (c *Client) SendDuration(name string, duration time.Duration) error
- func (c *Client) SendMebiBytes(name string, mebibytes int) error
- func (c *Client) SendMetric(name string, value int) error
- func (c *Client) SendRequestsPerSecond(name string, value float64) error
- type ClientOption
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 (*Client) IncrementCounterWithDelta ¶
func (*Client) SendAppErrorLog ¶
func (*Client) SendAppLog ¶
func (*Client) SendAppMetrics ¶
func (c *Client) SendAppMetrics(m *events.ContainerMetric) error
func (*Client) SendBytesPerSecond ¶
func (*Client) SendComponentMetric ¶
func (*Client) SendDuration ¶
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