internal

package
v0.0.0-...-c91b0e7 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExporterConf

type ExporterConf struct {
	PrometheusURL string
	OpentsdbURL   string
	BulkSize      uint
	ThreadCount   uint
	PushTimeout   string
	LoggingLevel  string
}

ExporterConf modelize an exporter configuration

func GetExporterConf

func GetExporterConf(f string) (ExporterConf, error)

GetExporterConf loads an exporter configuration

type Opentsdb

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

Opentsdb is an Opentsdb connector

func NewOpentsdb

func NewOpentsdb(c ExporterConf) (Opentsdb, error)

NewOpentsdb instanciates an Opentsdb connector

func (Opentsdb) Push

func (o Opentsdb) Push(ctx context.Context, m []OpentsdbMetric) error

Push pushes metrics to Opentsdb

type OpentsdbMetric

type OpentsdbMetric struct {
	// Metric is the metric name
	Metric string `json:"metric"`
	// Timestamp is the metric timestamp (UTC timestamp)
	Timestamp uint64 `json:"timestamp"`
	// Value is the value of the Metric
	Value float32 `json:"value"`
	// Tags describes the metric tags
	Tags map[string]string `json:"tags"`
}

OpentsdbMetric describes a metric based on Opentsdb specifications

type Prometheus

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

Prometheus is a Prometheus connector

func NewPrometheus

func NewPrometheus(c ExporterConf) (Prometheus, error)

NewPrometheus instanciates a Prometheus connector

func (Prometheus) Query

func (p Prometheus) Query(ctx context.Context, c QueryConf) ([]OpentsdbMetric, error)

Query executes the query

type QueryConf

type QueryConf struct {
	// Output metric name
	MetricName string
	// Query to execute in Prometheus
	Query string
	// Step of the query
	Step string
	// Start time
	Start time.Time
	// End time
	End time.Time
	// Tags to add
	AddTags map[string]string
	// Tags to remove
	RemoveTags []string
	// Tags to rename
	RenameTags map[string]string
}

QueryConf modelize a query configuration

func GetQueryConf

func GetQueryConf(f string) (QueryConf, error)

GetQueryConf loads a query configuration

Jump to

Keyboard shortcuts

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