sink

package
v0.0.0-...-2a9c997 Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitElasticSearchSink

func InitElasticSearchSink(opts map[string]string) error

func InitSinkDriver

func InitSinkDriver(opts map[string]string) error

Types

type ElasticSearchSink

type ElasticSearchSink struct {
	Endpoint  string
	IndexName string
	TypeName  string
	Path      string
}

func GetElasticSearchSink

func GetElasticSearchSink() *ElasticSearchSink

func NewElasticSearchSink

func NewElasticSearchSink(opts map[string]string) (*ElasticSearchSink, error)

func (*ElasticSearchSink) WriteEvents

func (es *ElasticSearchSink) WriteEvents(events []*types.Event) error

type KafkaSink

type KafkaSink struct {
	Brokers  string
	Topic    string
	Producer sarama.AsyncProducer
}

func (*KafkaSink) Write

func (kafka *KafkaSink) Write(metrics *types.MetricPayload) error

type OpentsdbSink

type OpentsdbSink struct {
	Endpoint string
}

func (*OpentsdbSink) Write

func (opentsdb *OpentsdbSink) Write(metrics *types.MetricPayload) error

Write points to opentsdb. http://opentsdb.net/docs/build/html/api_http/put.html Data points: [

{
  "metric": "sys.cpu.nice",
  "timestamp": 1346846400,
  "value": 18,
  "tags": {
    "host": "web01",
    "dc": "lga"
  }
},
{
  "metric": "sys.cpu.nice",
  "timestamp": 1346846400,
  "value": 9,
  "tags": {
    "host": "web02",
    "dc": "lga"
  }
}

]

type SinkDriver

type SinkDriver interface {
	Write(*types.MetricPayload) error
}

func GetSinkDriver

func GetSinkDriver() SinkDriver

func NewKafkaSink

func NewKafkaSink(opts map[string]string) (SinkDriver, error)

func NewOpentsdbSink

func NewOpentsdbSink(opts map[string]string) (SinkDriver, error)

Jump to

Keyboard shortcuts

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