Documentation
¶
Index ¶
- Constants
- Variables
- func GraphiteMetric(metricName string, tags map[string]string, timestamp int64, value interface{}, ...) telegraf.Metric
- func GraphiteWindowsMetric(metricName string, tags map[string]string, timestamp int64, value interface{}, ...) telegraf.Metric
- func NewBeringeiBackend(cfg *BeringeiOutputConfig) (*beringeiBackend, error)
- func NewGraphiteBackend(cfg *GraphiteOutputConfig) (*graphiteBackend, error)
- type Beringei
- type BeringeiConfig
- type BeringeiOutputConfig
- type BeringeiPoint
- type Config
- type GraphiteConfig
- type GraphiteOutputConfig
- type GraphiteRelay
- type HTTP
- type HTTPConfig
- type HTTPOutputConfig
- type M
- type Operation
- type Relay
- type Service
- type UDP
- type UDPConfig
- type UDPOutputConfig
Constants ¶
Variables ¶
View Source
var ErrBufferFull = errors.New("retry buffer full")
View Source
var RelayCache *cache.Cache
RelayCache is the in-mem cache used to store BeringeiPoint
Functions ¶
func GraphiteMetric ¶
func GraphiteMetric(metricName string, tags map[string]string, timestamp int64, value interface{}, field string) telegraf.Metric
GraphiteMetric transforms a BeringeiPoint to Graphite compatible format
func GraphiteWindowsMetric ¶ added in v0.5.1
func GraphiteWindowsMetric(metricName string, tags map[string]string, timestamp int64, value interface{}, field string) telegraf.Metric
GraphiteMetric transforms a BeringeiPoint to Graphite compatible format
func NewBeringeiBackend ¶
func NewBeringeiBackend(cfg *BeringeiOutputConfig) (*beringeiBackend, error)
NewBeringeiBackend Initializes a new Beringei Backend
func NewGraphiteBackend ¶
func NewGraphiteBackend(cfg *GraphiteOutputConfig) (*graphiteBackend, error)
NewGraphiteBackend Initializes a new Graphite Backend
Types ¶
type Beringei ¶
type Beringei struct {
// contains filtered or unexported fields
}
Beringei is a relay for Beringei writes
type BeringeiConfig ¶
type BeringeiConfig struct {
//Name identifies the beringei relay
Name string `toml:"name"`
// Addr is where the UDP relay will listen for packets
Addr string `toml:"bind-addr"`
// SSLCombinedPem set certificate in order to handle HTTPS requests
SSLCombinedPem string `toml:"ssl-combined-pem"`
// AMQPUrl will be used to connect to Rabbitmq (amqp://guest:guest@127.0.0.1:5672/)
AMQPUrl string `toml:"amqp-url"`
BeringeiUpdateURL string `toml:"beringei-update-url"`
// Outputs is a list of backend servers where writes will be forwarded
Outputs []BeringeiOutputConfig `toml:"output"`
// GraphiteOutput is a list of graphite backends
GraphiteOutput string `toml:"graphite-output"`
}
type BeringeiOutputConfig ¶
type BeringeiPoint ¶
type BeringeiPoint struct {
Name string
Timestamp int64
Tags map[string]string
Field string
Value interface{}
ID string
}
BeringeiPoint is the Point that we push to Rabbitmq
func NewBeringeiPoint ¶
func NewBeringeiPoint(name, field string, timestamp int64, tags map[string]string, value interface{}) *BeringeiPoint
NewBeringeiPoint Initializes and returns a new BeringeiPoint
type Config ¶
type Config struct {
HTTPRelays []HTTPConfig `toml:"http"`
UDPRelays []UDPConfig `toml:"udp"`
BeringeiRelays []BeringeiConfig `toml:"beringei"`
GraphiteRelays []GraphiteConfig `toml:"graphite"`
}
func LoadConfigFile ¶
LoadConfigFile parses the specified file into a Config object
type GraphiteConfig ¶
type GraphiteConfig struct {
// Name identifies the graphite relay
Name string `toml:"name"`
// Addr is where the Graphite Relay will listen for packets
Addr string `toml:"bind-addr"`
// SSLCombinedPem set certificate in order to handle HTTPS requests
SSLCombinedPem string `toml:"ssl-combined-pem"`
// EnableMetering toggles metering stats to Rabbitmq. You have to setup AMQPUrl for this
EnableMetering bool `toml:"enable-metering"`
// AMQPUrl will be used to connect to Rabbitmq (amqp://guest:guest@127.0.0.1:5672/)
AMQPUrl string `toml:"amqp-url"`
// If set to false, it will create an "Unknown" directory in graphite
DropUnauthorized bool `toml:"drop-unauthorized"`
CronSchedule string `toml:"cron-schedule"`
// A list of graphite backend servers
Outputs []GraphiteOutputConfig `toml:"output"`
}
type GraphiteOutputConfig ¶
type GraphiteRelay ¶
type GraphiteRelay struct {
// contains filtered or unexported fields
}
GraphiteRelay is a relay for graphite backends
func (*GraphiteRelay) Name ¶
func (g *GraphiteRelay) Name() string
func (*GraphiteRelay) Run ¶
func (g *GraphiteRelay) Run() error
func (*GraphiteRelay) ServeHTTP ¶
func (g *GraphiteRelay) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*GraphiteRelay) Stop ¶
func (g *GraphiteRelay) Stop() error
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
HTTP is a relay for HTTP influxdb writes
type HTTPConfig ¶
type HTTPConfig struct {
// Name identifies the HTTP relay
Name string `toml:"name"`
// Addr should be set to the desired listening host:port
Addr string `toml:"bind-addr"`
// Set certificate in order to handle HTTPS requests
SSLCombinedPem string `toml:"ssl-combined-pem"`
// Default retention policy to set for forwarded requests
DefaultRetentionPolicy string `toml:"default-retention-policy"`
// EnableMetering toggles metering stats to Rabbitmq. You have to setup AMQPUrl for this
EnableMetering bool `toml:"enable-metering"`
// AMQPUrl will be used to connect to Rabbitmq (amqp://guest:guest@127.0.0.1:5672/)
AMQPUrl string `toml:"amqp-url"`
// If set to false, it will create an "Unknown" directory in graphite
DropUnauthorized bool `toml:"drop-unauthorized"`
CronSchedule string `toml:"cron-schedule"`
// Max allowed number of datapoints per request (0 = Accept all)
MaxDatapointsPerRequest int `toml:"max-datapoints-per-request"`
// Split request per number of datapoints (0 = Don't split)
SplitRequestPerDatapoints int `toml:"split-request-per-datapoints"`
// Send successful response to telegraf regardless the outcome
ItsAllGoodMan bool `toml:"its-all-good-man"`
// Outputs is a list of backed servers where writes will be forwarded
Outputs []HTTPOutputConfig `toml:"output"`
}
type HTTPOutputConfig ¶
type HTTPOutputConfig struct {
// Name of the backend server
Name string `toml:"name"`
// Location should be set to the URL of the backend server's write endpoint
Location string `toml:"location"`
// Type of the backend server e.g. influxdb, graphite, etc.
BackendType string `toml:"type"`
// Timeout sets a per-backend timeout for write requests. (Default 10s)
// The format used is the same seen in time.ParseDuration
Timeout string `toml:"timeout"`
// Buffer failed writes up to maximum count. (Default 0, retry/buffering disabled)
BufferSizeMB int `toml:"buffer-size-mb"`
// Maximum batch size in KB (Default 512)
MaxBatchKB int `toml:"max-batch-kb"`
// Maximum delay between retry attempts.
// The format used is the same seen in time.ParseDuration (Default 10s)
MaxDelayInterval string `toml:"max-delay-interval"`
// Skip TLS verification in order to use self signed certificate.
// WARNING: It's insecure. Use it only for developing and don't use in production.
SkipTLSVerification bool `toml:"skip-tls-verification"`
}
type Relay ¶
func NewBeringei ¶
func NewBeringei(cfg BeringeiConfig) (Relay, error)
func NewGraphiteRelay ¶
func NewGraphiteRelay(cfg GraphiteConfig) (Relay, error)
func NewHTTP ¶
func NewHTTP(cfg HTTPConfig) (Relay, error)
type UDP ¶
type UDP struct {
// contains filtered or unexported fields
}
UDP is a relay for UDP influxdb writes
type UDPConfig ¶
type UDPConfig struct {
// Name identifies the UDP relay
Name string `toml:"name"`
// Addr is where the UDP relay will listen for packets
Addr string `toml:"bind-addr"`
// Precision sets the precision of the timestamps (input and output)
Precision string `toml:"precision"`
// ReadBuffer sets the socket buffer for incoming connections
ReadBuffer int `toml:"read-buffer"`
// Outputs is a list of backend servers where writes will be forwarded
Outputs []UDPOutputConfig `toml:"output"`
}
type UDPOutputConfig ¶
Click to show internal directories.
Click to hide internal directories.