exporter

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func (*Component) Start

func (c *Component) Start() error

Start starts the exporter component

func (*Component) Stop

func (c *Component) Stop() error

Stop the exporters

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

Jump to

Keyboard shortcuts

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