Documentation ¶
Index ¶
- Constants
- Variables
- func Run(configPath string) error
- type CheckPlugin
- type CheckResult
- type CloudWatchDriver
- type Config
- type Dimension
- type MackerelDriver
- type Metric
- type MetricPlugin
- type PluginConfig
- func (pc *PluginConfig) NewCheckPlugin(id string) (*CheckPlugin, error)
- func (pc *PluginConfig) NewMackerelMetricPlugin(conf *Config, id string, ch chan []*mackerel.HostMetricValue) (*MetricPlugin, error)
- func (pc *PluginConfig) NewMetricPlugin(id string, ch chan *cloudwatch.PutMetricDataInput) (*MetricPlugin, error)
- type PluginDriver
Constants ¶
View Source
const (
PluginPrefix = "custom."
)
Variables ¶
Functions ¶
Types ¶
type CheckPlugin ¶
type CheckPlugin struct { ID string Namespace string Command string Timeout time.Duration Interval time.Duration Dimensions [][]*cloudwatch.Dimension }
func (*CheckPlugin) Execute ¶
func (cp *CheckPlugin) Execute(_ctx context.Context) (CheckResult, error)
func (*CheckPlugin) Run ¶
func (cp *CheckPlugin) Run(ctx context.Context, ch chan *cloudwatch.PutMetricDataInput)
type CheckResult ¶
type CheckResult int
const ( CheckOK CheckResult = iota CheckFailed CheckWarning CheckUnknown )
func (CheckResult) NewMetricDatum ¶
func (r CheckResult) NewMetricDatum(ds []*cloudwatch.Dimension, ts time.Time) *cloudwatch.MetricDatum
func (CheckResult) String ¶
func (i CheckResult) String() string
type CloudWatchDriver ¶ added in v0.1.0
type CloudWatchDriver struct { Dimensions [][]*cloudwatch.Dimension Ch chan *cloudwatch.PutMetricDataInput }
type Config ¶
type Config struct { APIKey string Plugin map[string]map[string]*PluginConfig MetricPlugins map[string]*MetricPlugin CheckPlugins map[string]*CheckPlugin CustomIdentifierList sync.Map MackerelClient *mackerel.Client // contains filtered or unexported fields }
func LoadConfig ¶
func LoadConfig(path string, ch chan *cloudwatch.PutMetricDataInput, mch chan []*mackerel.HostMetricValue) (*Config, error)
type Dimension ¶
type Dimension string
func (*Dimension) CloudWatchDimensions ¶
func (d *Dimension) CloudWatchDimensions() ([]*cloudwatch.Dimension, error)
type MackerelDriver ¶ added in v0.1.0
type MackerelDriver struct { HostID string Ch chan []*mackerel.HostMetricValue }
type Metric ¶
func (*Metric) NewMackerelMetric ¶ added in v0.1.0
func (*Metric) NewMetricDatum ¶
func (m *Metric) NewMetricDatum(ds []*cloudwatch.Dimension) *cloudwatch.MetricDatum
type MetricPlugin ¶
type MetricPlugin struct { ID string Command string Timeout time.Duration Interval time.Duration PluginDriver PluginDriver }
func (*MetricPlugin) Execute ¶
func (mp *MetricPlugin) Execute(_ctx context.Context) ([]*Metric, error)
func (*MetricPlugin) GraphDef ¶ added in v0.1.0
func (mp *MetricPlugin) GraphDef() (interface{}, error)
func (*MetricPlugin) Run ¶
func (mp *MetricPlugin) Run(ctx context.Context)
type PluginConfig ¶
type PluginConfig struct { Namespace string Command string Timeout duration Interval duration Dimensions []*Dimension CustomIdentifier string `toml:"custom_identifier"` }
func (*PluginConfig) NewCheckPlugin ¶
func (pc *PluginConfig) NewCheckPlugin(id string) (*CheckPlugin, error)
func (*PluginConfig) NewMackerelMetricPlugin ¶ added in v0.1.0
func (pc *PluginConfig) NewMackerelMetricPlugin(conf *Config, id string, ch chan []*mackerel.HostMetricValue) (*MetricPlugin, error)
func (*PluginConfig) NewMetricPlugin ¶
func (pc *PluginConfig) NewMetricPlugin(id string, ch chan *cloudwatch.PutMetricDataInput) (*MetricPlugin, error)
type PluginDriver ¶ added in v0.1.0
type PluginDriver interface {
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.