Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatapointValueToFloat64 ¶
DatapointValueToFloat64 converts a Datapoint's Value from an interface{} to a float64.
Types ¶
type Option ¶
Option lets each plugin configure the Plugin type. The plugin.New(...) method will call each supplied Option before returning the initialized Plugin.
func ConnectorFunc ¶
ConnectorFunc is what the plugin framework will call once it has gathered metrics. It is expected that this function will convert these messages to a 3rd party format and then send the metrics to that service.
func ExtraFlags ¶
ExtraFlags sets additional cli.Flag's on the Plugin
func PollingInterval ¶
PollingInterval sets the polling interval to the supplied value.
type Plugin ¶
type Plugin struct {
App *cli.App
Name string
Endpoints []string
Role string
PollingInterval int
Log *logrus.Entry
ConnectorFunc func([]producers.MetricsMessage, *cli.Context) error
BeforeFunc func(*cli.Context) error
AfterFunc func(*cli.Context) error
Client *http.Client
}
Plugin is used to collect metrics and then send them to a remote system (e.g. DataDog, Librato, etc.). Use plugin.New(...) to build a new plugin.
func (*Plugin) Metrics ¶
func (p *Plugin) Metrics() ([]producers.MetricsMessage, error)
Metrics queries the local dcos-metrics API and returns a slice of producers.MetricsMessage.
func (*Plugin) StartPlugin ¶
StartPlugin starts a (previously configured) Plugin. It will periodically poll the system for metrics and send them to the ConnectorFunc. This method will block.