Documentation ¶
Index ¶
- Constants
- func NativeCarbonLine(dp *datapoint.Datapoint) (string, bool)
- func NewCarbonDatapoint(line string, metricDeconstructor metricdeconstructor.MetricDeconstructor) (*datapoint.Datapoint, error)
- type Forwarder
- func (f *Forwarder) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint) (err error)
- func (f *Forwarder) Close() error
- func (f *Forwarder) Datapoints() []*datapoint.Datapoint
- func (f *Forwarder) DebugDatapoints() []*datapoint.Datapoint
- func (f *Forwarder) DefaultDatapoints() []*datapoint.Datapoint
- type ForwarderConfig
- type Listener
- type ListenerConfig
Constants ¶
const ( TCP = "tcp" UDP = "udp" )
Constants for udp and tcp config
Variables ¶
This section is empty.
Functions ¶
func NativeCarbonLine ¶
NativeCarbonLine inspects the datapoints metadata to see if it has information about the carbon source it came from
func NewCarbonDatapoint ¶
func NewCarbonDatapoint(line string, metricDeconstructor metricdeconstructor.MetricDeconstructor) (*datapoint.Datapoint, error)
NewCarbonDatapoint creates a new datapoint from a line in carbon and injects into the datapoint metadata about the original line.
Types ¶
type Forwarder ¶
type Forwarder struct { filtering.FilteredForwarder // contains filtered or unexported fields }
Forwarder is a sink that forwards points to a carbon endpoint
func NewForwarder ¶
func NewForwarder(host string, passedConf *ForwarderConfig) (*Forwarder, error)
NewForwarder creates a new unbuffered forwarder for sending points to carbon
func (*Forwarder) AddDatapoints ¶
AddDatapoints sends the points to a carbon endpoint. Tries to reuse open connections
func (*Forwarder) Datapoints ¶
Datapoints satisfies the sfxclient.Collector interface
func (*Forwarder) DebugDatapoints ¶
DebugDatapoints returns connection pool datapoints
func (*Forwarder) DefaultDatapoints ¶
DefaultDatapoints does nothing and exists to satisfy the protocol.Forwarder interface
type ForwarderConfig ¶
type ForwarderConfig struct { Filters *filtering.FilterObj Port *uint16 Timeout *time.Duration DimensionOrder []string IdleConnectionPoolSize *int64 Timer timekeeper.TimeKeeper }
ForwarderConfig controls optional parameters for a carbon forwarder
type Listener ¶
type Listener struct { protocol.CloseableHealthCheck // contains filtered or unexported fields }
Listener once setup will listen for carbon protocol points to forward on
func NewListener ¶
func NewListener(sendTo dpsink.Sink, passedConf *ListenerConfig) (*Listener, error)
NewListener creates a new listener for carbon datapoints
func (*Listener) Datapoints ¶
Datapoints reports information about the total points seen by carbon
func (*Listener) DebugDatapoints ¶
DebugDatapoints returns datapoints that are used for debugging the listener
func (*Listener) DefaultDatapoints ¶
DefaultDatapoints returns datapoints that should always be reported from the listener
type ListenerConfig ¶
type ListenerConfig struct { ServerAcceptDeadline *time.Duration ConnectionTimeout *time.Duration ListenAddr *string MetricDeconstructor metricdeconstructor.MetricDeconstructor Logger log.Logger Protocol *string }
ListenerConfig controls optional parameters for carbon listeners