emitter

package
v6.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoGarbageCollection

func DoGarbageCollection(emitter PrometheusGarbageCollectable, worker string)

DoGarbageCollection retrieves and deletes stale metrics by their labels.

Types

type DogstatsDBConfig

type DogstatsDBConfig struct {
	Host   string `long:"datadog-agent-host" description:"Datadog agent host to expose dogstatsd metrics"`
	Port   string `long:"datadog-agent-port" description:"Datadog agent port to expose dogstatsd metrics"`
	Prefix string `long:"datadog-prefix" description:"Prefix for all metrics to easily find them in Datadog"`
}

func (*DogstatsDBConfig) Description

func (config *DogstatsDBConfig) Description() string

func (*DogstatsDBConfig) IsConfigured

func (config *DogstatsDBConfig) IsConfigured() bool

func (*DogstatsDBConfig) NewEmitter

func (config *DogstatsDBConfig) NewEmitter() (metric.Emitter, error)

type DogstatsdEmitter

type DogstatsdEmitter struct {
	// contains filtered or unexported fields
}

func (*DogstatsdEmitter) Emit

func (emitter *DogstatsdEmitter) Emit(logger lager.Logger, event metric.Event)

type InfluxDBClient

type InfluxDBClient interface {
	// Ping checks that status of cluster, and will always return 0 time and no
	// error for UDP clients.
	Ping(timeout time.Duration) (time.Duration, string, error)

	// Write takes a BatchPoints object and writes all Points to InfluxDB.
	Write(bp influxclient.BatchPoints) error

	// Query makes an InfluxDB Query on the database. This will fail if using
	// the UDP client.
	Query(q influxclient.Query) (*influxclient.Response, error)

	// QueryAsChunk makes an InfluxDB Query on the database. This will fail if using
	// the UDP client.
	QueryAsChunk(q influxclient.Query) (*influxclient.ChunkedResponse, error)

	// Close releases any resources a Client may be using.
	Close() error
}

Client is a client interface for writing & querying the database.

type InfluxDBConfig

type InfluxDBConfig struct {
	URL string `long:"influxdb-url" description:"InfluxDB server address to emit points to."`

	Database string `long:"influxdb-database" description:"InfluxDB database to write points to."`

	Username string `long:"influxdb-username" description:"InfluxDB server username."`
	Password string `long:"influxdb-password" description:"InfluxDB server password."`

	InsecureSkipVerify bool `long:"influxdb-insecure-skip-verify" description:"Skip SSL verification when emitting to InfluxDB."`

	BatchSize     uint32        `long:"influxdb-batch-size" default:"5000" description:"Number of points to batch together when emitting to InfluxDB."`
	BatchDuration time.Duration `` /* 161-byte string literal not displayed */
}

func (*InfluxDBConfig) Description

func (config *InfluxDBConfig) Description() string

func (*InfluxDBConfig) IsConfigured

func (config *InfluxDBConfig) IsConfigured() bool

func (*InfluxDBConfig) NewEmitter

func (config *InfluxDBConfig) NewEmitter() (metric.Emitter, error)

type InfluxDBEmitter

type InfluxDBEmitter struct {
	Client        influxclient.Client
	Database      string
	BatchSize     int
	BatchDuration time.Duration
}

func (*InfluxDBEmitter) Emit

func (emitter *InfluxDBEmitter) Emit(logger lager.Logger, event metric.Event)

func (*InfluxDBEmitter) SubmitBatch

func (emitter *InfluxDBEmitter) SubmitBatch(logger lager.Logger)

type LagerConfig

type LagerConfig struct {
	Enabled bool `long:"emit-to-logs" description:"Emit metrics to logs."`
}

func (*LagerConfig) Description

func (config *LagerConfig) Description() string

func (*LagerConfig) IsConfigured

func (config *LagerConfig) IsConfigured() bool

func (*LagerConfig) NewEmitter

func (config *LagerConfig) NewEmitter() (metric.Emitter, error)

type LagerEmitter

type LagerEmitter struct{}

func (*LagerEmitter) Emit

func (emitter *LagerEmitter) Emit(logger lager.Logger, event metric.Event)

type NewRelicConfig

type NewRelicConfig struct {
	AccountID          string        `long:"newrelic-account-id" description:"New Relic Account ID"`
	APIKey             string        `long:"newrelic-api-key" description:"New Relic Insights API Key"`
	Url                string        `` /* 129-byte string literal not displayed */
	ServicePrefix      string        `long:"newrelic-service-prefix" default:"" description:"An optional prefix for emitted New Relic events"`
	BatchSize          uint64        `long:"newrelic-batch-size" default:"2000" description:"Number of events to batch together before emitting"`
	BatchDuration      time.Duration `` /* 145-byte string literal not displayed */
	DisableCompression bool          `long:"newrelic-batch-disable-compression" description:"Disables compression of the batch before sending it"`
}

func (*NewRelicConfig) Description

func (config *NewRelicConfig) Description() string

func (*NewRelicConfig) IsConfigured

func (config *NewRelicConfig) IsConfigured() bool

func (*NewRelicConfig) NewEmitter

func (config *NewRelicConfig) NewEmitter() (metric.Emitter, error)

type NewRelicEmitter

type NewRelicEmitter struct {
	Client *http.Client
	Url    string

	BatchSize          int
	BatchDuration      time.Duration
	DisableCompression bool
	LastEmitTime       time.Time
	NewRelicBatch      []NewRelicEvent
	// contains filtered or unexported fields
}

func (*NewRelicEmitter) Emit

func (emitter *NewRelicEmitter) Emit(logger lager.Logger, event metric.Event)

type NewRelicEvent

type NewRelicEvent map[string]interface{}

type PrometheusConfig

type PrometheusConfig struct {
	BindIP   string `long:"prometheus-bind-ip" description:"IP to listen on to expose Prometheus metrics."`
	BindPort string `long:"prometheus-bind-port" description:"Port to listen on to expose Prometheus metrics."`
}

func (*PrometheusConfig) Description

func (config *PrometheusConfig) Description() string

func (*PrometheusConfig) IsConfigured

func (config *PrometheusConfig) IsConfigured() bool

func (*PrometheusConfig) NewEmitter

func (config *PrometheusConfig) NewEmitter() (metric.Emitter, error)

type PrometheusEmitter

type PrometheusEmitter struct {
	// contains filtered or unexported fields
}

func (*PrometheusEmitter) Emit

func (emitter *PrometheusEmitter) Emit(logger lager.Logger, event metric.Event)

Emit processes incoming metrics. In order to provide idiomatic Prometheus metrics, we'll have to convert the various Event types (differentiated by the less-than-ideal string Name field) into different Prometheus metrics.

func (*PrometheusEmitter) WorkerContainers

func (emitter *PrometheusEmitter) WorkerContainers() *prometheus.GaugeVec

func (*PrometheusEmitter) WorkerContainersLabels

func (emitter *PrometheusEmitter) WorkerContainersLabels() map[string]map[string]prometheus.Labels

func (*PrometheusEmitter) WorkerTasks

func (emitter *PrometheusEmitter) WorkerTasks() *prometheus.GaugeVec

func (*PrometheusEmitter) WorkerTasksLabels

func (emitter *PrometheusEmitter) WorkerTasksLabels() map[string]map[string]prometheus.Labels

func (*PrometheusEmitter) WorkerVolumes

func (emitter *PrometheusEmitter) WorkerVolumes() *prometheus.GaugeVec

func (*PrometheusEmitter) WorkerVolumesLabels

func (emitter *PrometheusEmitter) WorkerVolumesLabels() map[string]map[string]prometheus.Labels

type PrometheusGarbageCollectable

type PrometheusGarbageCollectable interface {
	WorkerContainers() *prometheus.GaugeVec
	WorkerVolumes() *prometheus.GaugeVec
	WorkerTasks() *prometheus.GaugeVec

	WorkerContainersLabels() map[string]map[string]prometheus.Labels
	WorkerVolumesLabels() map[string]map[string]prometheus.Labels
	WorkerTasksLabels() map[string]map[string]prometheus.Labels
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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