Documentation ¶
Index ¶
- Constants
- func CreateIndexIfNotExists(e *elastic.Client, index string) error
- type Backend
- type Channels
- type Config
- func (backend *Config) Clean()
- func (backend *Config) Disconnect()
- func (backend *Config) HasMetadata() bool
- func (backend *Config) Init() (*chan Channels, error)
- func (backend *Config) InitPrometheus(vcenter string) error
- func (backend *Config) Scheduled() bool
- func (backend *Config) SendMetrics(metrics []*Point, cleanup bool)
- type InfluxPoint
- type MapStr
- type Point
- type PrometheusBackend
- type ThinPrometheusClient
Constants ¶
const ( // Graphite name of the graphite backend Graphite = "graphite" // InfluxDB name of the influx db backend InfluxDB = "influxdb" // ThinInfluxDB name of the thin influx db backend ThinInfluxDB = "thininfluxdb" // InfluxTag is the tag for influxdb InfluxTag = "influx" // Elastic name of the elastic backend Elastic = "elastic" // Prometheus name of the prometheus backend Prometheus = "prometheus" // Fluentd name of the fluentd backend Fluentd = "fluentd" // ThinPrometheus name of the thin prometheus backend ThinPrometheus = "thinprometheus" // Kafka name of the kafka backend Kafka = "kafka" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Hostname string ValueField string Database string Username string Password string Type string Prefix string Port int NoArray bool Encrypted bool // contains filtered or unexported fields }
Config : storage backend
func (*Config) Clean ¶
func (backend *Config) Clean()
Clean : take actions on backend when cycle finished
func (*Config) Disconnect ¶
func (backend *Config) Disconnect()
Disconnect : disconnect from backend
func (*Config) HasMetadata ¶
HasMetadata indicates that the backend supports metadata
func (*Config) InitPrometheus ¶
InitPrometheus : Init Multiple channels for prometheus
func (*Config) Scheduled ¶
Scheduled indicates that the metric collection needs to be scheduled for the backend
func (*Config) SendMetrics ¶
SendMetrics : send metrics to backend
type InfluxPoint ¶
type InfluxPoint struct { Key string Fields map[string]string Tags map[string]string Timestamp int64 }
InfluxPoint is the representation of the parts of a point for influx
type MapStr ¶
type MapStr map[string]interface{}
MapStr represents a json node (string reference to an object)
type Point ¶
type Point struct { VCenter string `influx:"tag,vcenter"` ObjectType string `influx:"tag,type"` ObjectName string `influx:"tag,name"` Group string `influx:"key,1"` Counter string `influx:"key,2"` Instance string `influx:"tag,instance"` Rollup string `influx:"key,3"` Value int64 `influx:"value"` Datastore []string `influx:"tag,datastore" json:",omitempty"` ESXi string `influx:"tag,host" json:",omitempty"` Cluster string `influx:"tag,cluster" json:",omitempty"` Network []string `influx:"tag,network" json:",omitempty"` ResourcePool string `influx:"tag,resourcepool" json:",omitempty"` Folder string `influx:"tag,folder" json:",omitempty"` ViTags []string `influx:"tag,vitags" json:",omitempty"` Timestamp int64 `influx:"time" elastic:"type:date,format:epoch_second"` }
Point : Information collected for a point
func (*Point) GetInfluxPoint ¶
func (point *Point) GetInfluxPoint(noarray bool, valuefield string) *InfluxPoint
GetInfluxPoint : convert a point to an influxpoint
type PrometheusBackend ¶
PrometheusBackend : Extend prometheus.Collector
func (*PrometheusBackend) Collect ¶
func (backend *PrometheusBackend) Collect(ch chan<- prometheus.Metric)
Collect : Implementation of Prometheus Collector.Collect
func (*PrometheusBackend) Describe ¶
func (backend *PrometheusBackend) Describe(ch chan<- *prometheus.Desc)
Describe : Implementation of Prometheus Collector.Describe
func (*PrometheusBackend) PrometheusSend ¶
func (backend *PrometheusBackend) PrometheusSend(ch chan<- prometheus.Metric, point Point)
PrometheusSend sends a point to prometheus
type ThinPrometheusClient ¶
type ThinPrometheusClient struct { Hostname string Port int // contains filtered or unexported fields }
ThinPrometheusClient tries to export metrics to prometheus as simply as possible
func NewThinPrometheusClient ¶
func NewThinPrometheusClient(server string, port int) (ThinPrometheusClient, error)
NewThinPrometheusClient creates a new thin prometheus
func (*ThinPrometheusClient) ListenAndServe ¶
func (client *ThinPrometheusClient) ListenAndServe() error
ListenAndServe will start the listen thread for metric requests