Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDatapoint ¶
func NewDatapoint(point *JSONWriteFormat, index uint, defaultDimensions map[string]string) *datapoint.Datapoint
NewDatapoint creates a new datapoint from collectd's write_http endpoint JSON format defaultDimensions are added to the datapoint created, but will be overridden by any dimension values in the JSON
Types ¶
type JSONDecoder ¶
JSONDecoder can decode collectd's native JSON datapoint format
func (*JSONDecoder) ServeHTTPC ¶
func (decoder *JSONDecoder) ServeHTTPC(ctx context.Context, rw http.ResponseWriter, req *http.Request)
ServeHTTPC decodes datapoints for the connection and sends them to the decoder's sink
type JSONWriteBody ¶
type JSONWriteBody []*JSONWriteFormat
JSONWriteBody is the full POST body of collectd's write_http format
type JSONWriteFormat ¶
type JSONWriteFormat struct { Dsnames []*string `json:"dsnames"` Dstypes []*string `json:"dstypes"` Host *string `json:"host"` Interval *float64 `json:"interval"` Plugin *string `json:"plugin"` PluginInstance *string `json:"plugin_instance"` Time *float64 `json:"time"` TypeS *string `json:"type"` TypeInstance *string `json:"type_instance"` Values []*float64 `json:"values"` }
JSONWriteFormat is the format for collectd json datapoints
type ListenerServer ¶
ListenerServer will listen for collectd datapoint connections
func ListenerLoader ¶
func ListenerLoader(ctx context.Context, sink dpsink.Sink, listenFrom *config.ListenFrom) (*ListenerServer, error)
ListenerLoader loads a listener for collectd write_http protocol
func StartListeningCollectDHTTPOnPort ¶
func StartListeningCollectDHTTPOnPort(ctx context.Context, sink dpsink.Sink, listenAddr string, listenPath string, clientTimeout time.Duration, name string) (*ListenerServer, error)
StartListeningCollectDHTTPOnPort servers http collectd requests
func (*ListenerServer) Close ¶
func (streamer *ListenerServer) Close() error
Close the socket currently open for collectd JSON connections