elasticsearch

package
v1.0.2-7 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureIndexTemplate

func EnsureIndexTemplate(ctx context.Context, client *elastic.Client, config *IndexTemplateConfig) error

Types

type IndexConfig

type IndexConfig struct {
	Alias   string
	MaxAge  string
	MaxDocs int64
	MaxSize string
}

IndexConfig is used to configure IndexService

type IndexService

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

IndexService will manage alias and indexes derived from the configured index alias

func NewIndexService

func NewIndexService(ctx context.Context, logger *zap.Logger, client *elastic.Client, config *IndexConfig) (*IndexService, error)

NewIndexService will ensure required alias and indexes exist. It will also monitor active index and rollover as necessary

type IndexTemplateConfig

type IndexTemplateConfig struct {
	Alias    string
	Shards   int
	Replicas int
}

IndexTemplateConfig is used to resolve template

type ReadConfig

type ReadConfig struct {
	Alias   string
	MaxDocs int
}

ReadConfig configures the ReadService

type ReadService

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

ReadService will proxy Prometheus queries to Elasticsearch

func NewReadService

func NewReadService(logger *zap.Logger, client *elastic.Client, config *ReadConfig) *ReadService

NewReadService will create a new ReadService

func (*ReadService) Read

func (svc *ReadService) Read(ctx context.Context, req []*prompb.Query) ([]*prompb.QueryResult, error)

Read will perform Elasticsearch query

type WriteConfig

type WriteConfig struct {
	Alias   string
	Daily   bool
	MaxAge  int
	MaxDocs int
	MaxSize int
	Workers int
	Stats   bool
}

WriteConfig is used to configure WriteService

type WriteService

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

WriteService will proxy Prometheus write requests to Elasticsearch

func NewWriteService

func NewWriteService(ctx context.Context, logger *zap.Logger, client *elastic.Client, config *WriteConfig) (*WriteService, error)

NewWriteService creates and returns a new elasticsearch WriteService

func (*WriteService) Close

func (svc *WriteService) Close() error

Close will close the underlying elasticsearch BulkProcessor

func (*WriteService) Collect

func (svc *WriteService) Collect(ch chan<- prometheus.Metric)

Collect fetches the statistics from the elasticsearch bulk processor, and delivers them as Prometheus metrics. It implements prometheus.Collector.

func (*WriteService) Describe

func (svc *WriteService) Describe(ch chan<- *prometheus.Desc)

Describe describes all the metrics exported by the memcached exporter. It implements prometheus.Collector.

func (*WriteService) Write

func (svc *WriteService) Write(req []*prompb.TimeSeries)

Write will enqueue Prometheus sample data to be batch written to Elasticsearch

Jump to

Keyboard shortcuts

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