Documentation ¶
Index ¶
- type Component
- type Configuration
- type Exporter
- type HTTPConfiguration
- type HTTPExporter
- type RiemannConfiguration
- type RiemannExporter
- func (c *RiemannExporter) GetConfig() interface{}
- func (c *RiemannExporter) IsStarted() bool
- func (c *RiemannExporter) Name() string
- func (c *RiemannExporter) Push(result *healthcheck.Result) error
- func (c *RiemannExporter) Reconnect() error
- func (c *RiemannExporter) Start() error
- func (c *RiemannExporter) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct { Logger *zap.Logger Config *Configuration ChanResult chan *healthcheck.Result Exporters map[string]Exporter MemoryStore *memorystore.MemoryStore // contains filtered or unexported fields }
Component the exporter component
func New ¶
func New(logger *zap.Logger, store *memorystore.MemoryStore, chanResult chan *healthcheck.Result, promComponent *prometheus.Prometheus, config *Configuration) (*Component, error)
New creates a new exporter component
type Configuration ¶
type Configuration struct { HTTP []HTTPConfiguration Riemann []RiemannConfiguration }
Configuration the main configuration for the exporter component
type Exporter ¶
type Exporter interface { Start() error Stop() error Reconnect() error IsStarted() bool Name() string GetConfig() interface{} Push(*healthcheck.Result) error }
Exporter the exporter interface
type HTTPConfiguration ¶
type HTTPConfiguration struct { Name string Host string Path string Port uint32 Protocol healthcheck.Protocol Headers map[string]string `json:"headers,omitempty"` Key string `json:"key,omitempty"` Cert string `json:"cert,omitempty"` Cacert string `json:"cacert,omitempty"` Insecure bool }
HTTPConfiguration The configuration for the HTTP exporter.
func (*HTTPConfiguration) UnmarshalYAML ¶
func (c *HTTPConfiguration) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML parses the configuration of the http component from YAML.
type HTTPExporter ¶
type HTTPExporter struct { Started bool Logger *zap.Logger URL string Config *HTTPConfiguration Client *http.Client }
HTTPExporter the http exporter struct
func NewHTTPExporter ¶
func NewHTTPExporter(logger *zap.Logger, config *HTTPConfiguration) (*HTTPExporter, error)
NewHTTPExporter creates a new HTTP exporter
func (*HTTPExporter) GetConfig ¶
func (c *HTTPExporter) GetConfig() interface{}
GetConfig returns the config of the exporter
func (*HTTPExporter) IsStarted ¶
func (c *HTTPExporter) IsStarted() bool
IsStarted returns the exporter status
func (*HTTPExporter) Name ¶
func (c *HTTPExporter) Name() string
Name returns the name of the exporter
func (*HTTPExporter) Push ¶
func (c *HTTPExporter) Push(result *healthcheck.Result) error
Push pushes events to the HTTP destination
func (*HTTPExporter) Reconnect ¶
func (c *HTTPExporter) Reconnect() error
Reconnect reconnects the HTTP exporter component
func (*HTTPExporter) Start ¶
func (c *HTTPExporter) Start() error
Start starts the HTTP exporter component
func (*HTTPExporter) Stop ¶
func (c *HTTPExporter) Stop() error
Stop stops the HTTP exporter component
type RiemannConfiguration ¶
type RiemannConfiguration struct { Name string Host string Port uint32 TTL healthcheck.Duration Key string `json:"key,omitempty"` Cert string `json:"cert,omitempty"` Cacert string `json:"cacert,omitempty"` Insecure bool }
RiemannConfiguration the Riemann exporter configuration
func (*RiemannConfiguration) UnmarshalYAML ¶
func (c *RiemannConfiguration) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML parses the configuration of the Riemann component from YAML.
type RiemannExporter ¶
type RiemannExporter struct { Started bool Logger *zap.Logger Config *RiemannConfiguration Client riemanngo.Client }
RiemannExporter the Riemann exporter struct
func NewRiemannExporter ¶
func NewRiemannExporter(logger *zap.Logger, config *RiemannConfiguration) (*RiemannExporter, error)
NewRiemannExporter creates a new Riemann exporter from the configuration
func (*RiemannExporter) GetConfig ¶
func (c *RiemannExporter) GetConfig() interface{}
GetConfig returns the config of the exporter
func (*RiemannExporter) IsStarted ¶
func (c *RiemannExporter) IsStarted() bool
IsStarted returns the exporter status
func (*RiemannExporter) Name ¶
func (c *RiemannExporter) Name() string
Name returns the name of the exporter
func (*RiemannExporter) Push ¶
func (c *RiemannExporter) Push(result *healthcheck.Result) error
Push pushes events to the desination
func (*RiemannExporter) Reconnect ¶
func (c *RiemannExporter) Reconnect() error
Reconnect reconnects the Riemann exporter component
func (*RiemannExporter) Start ¶
func (c *RiemannExporter) Start() error
Start starts the Riemann exporter component
func (*RiemannExporter) Stop ¶
func (c *RiemannExporter) Stop() error
Stop stops the Riemann exporter component