config

package
v0.0.0-...-e58a317 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReceivedSamples = prometheus.NewCounter(
		prometheus.CounterOpts{
			Name: "received_samples_total",
			Help: "Total number of received samples.",
		},
	)
	SentSamples = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "es_sent_samples_total",
			Help: "Total number of processed samples sent to remote storage.",
		},
		[]string{"remote"},
	)
	FailedSamples = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "es_failed_samples_total",
			Help: "Total number of processed samples which failed on send to remote storage.",
		},
		[]string{"remote"},
	)
	WriteSamples = prometheus.NewSummary(prometheus.SummaryOpts{
		Name: "es_adapter_write_timeseries_samples",
		Help: "How many samples each written timeseries has.",
	})
	ReadDuration = prometheus.NewHistogram(prometheus.HistogramOpts{
		Name: "es_adapter_read_latency_seconds",
		Help: "How long it took us to respond to read requests.",
	})
	ReadErrors = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "es_adapter_read_failed_total",
		Help: "How many selects from Elasticsearch failed.",
	})
	SentBatchDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "es_sent_batch_duration_seconds",
			Help:    "Duration of sample batch send calls to the remote storage.",
			Buckets: prometheus.DefBuckets,
		},
		[]string{"remote"},
	)
)

Apps's metrics

Functions

func BuildClient

func BuildClient() (Writer, Reader)

BuildClient returns elasticsearch's client with writer and reader functions

Types

type Config

type Config struct {
	ElasticsearchURL        string        `yaml:"elasticsearch.url"`
	ElasticsearchMaxRetries int           `yaml:"elasticsearch.max.retries"`
	ElasticIndexPerfix      string        `yaml:"elasticsearch.index.perfix"`
	ElasticType             string        `yaml:"elasticsearch.type"`
	RemoteTimeout           time.Duration `yaml:"web.timeout"`
	ListenAddr              string        `yaml:"web.listen.addr"`
	TelemetryPath           string        `yaml:"web.telemetry.path"`
	AwsElasticSearchService bool          `yaml:"elasticsearch.aws.service"`
}

Config for the app

func GetConfig

func GetConfig() *Config

GetConfig returns the app's configuration described on config.yaml on root

type Reader

type Reader interface {
	Read(req *remote.ReadRequest) ([]map[string]interface{}, error)
	Name() string
}

Reader represents the interface that each client must implement read function

type Writer

type Writer interface {
	Write(samples model.Samples) error
	Name() string
}

Writer represents the interface that each client must implement write function

Jump to

Keyboard shortcuts

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