Documentation ¶
Index ¶
- func DatapointValueToFloat64(value interface{}) (float64, error)
- func ParseDatapointTimestamp(timestamp string) (*time.Time, error)
- type Option
- func ConnectorFunc(connect func([]producers.MetricsMessage, *cli.Context) error) Option
- func ExtraFlags(extraFlags []cli.Flag) Option
- func MetricsHost(h string) Option
- func MetricsPort(port int) Option
- func MetricsProtocol(proto string) Option
- func Name(n string) Option
- func PollingInterval(i int) Option
- type Plugin
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 MetricsHost ¶
MetricsHost allows the plugin to set a custom hostname for the url it calls to gather metrics.
func MetricsPort ¶
MetricsPort allows the plugin to set a custom port for the url it calls to gather metrics.
func MetricsProtocol ¶
MetricsProtocol allows the plugin to set either "http" or "https" for the url it calls to gather metrics.
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 MetricsPort int MetricsScheme string MetricsHost string Log *logrus.Entry ConnectorFunc func([]producers.MetricsMessage, *cli.Context) error Client *http.Client ConfigPath string IAMConfigPath string `yaml:"iam_config_path"` CACertificatePath string `yaml:"ca_certificate_path"` }
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 polls the DC/OS components 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.