2020-02-16 18:59:02 +00:00
|
|
|
package datasource
|
|
|
|
|
2020-04-06 11:44:03 +00:00
|
|
|
import "context"
|
|
|
|
|
|
|
|
// Querier interface wraps Query method which
|
|
|
|
// executes given query and returns list of Metrics
|
|
|
|
// as result
|
|
|
|
type Querier interface {
|
|
|
|
Query(ctx context.Context, query string) ([]Metric, error)
|
|
|
|
}
|
|
|
|
|
2020-03-13 10:19:31 +00:00
|
|
|
// Metric is the basic entity which should be return by datasource
|
|
|
|
// It represents single data point with full list of labels
|
|
|
|
type Metric struct {
|
|
|
|
Labels []Label
|
|
|
|
Timestamp int64
|
|
|
|
Value float64
|
|
|
|
}
|
2020-02-16 18:59:02 +00:00
|
|
|
|
2020-03-13 10:22:23 +00:00
|
|
|
// Label represents metric's label
|
2020-03-13 10:19:31 +00:00
|
|
|
type Label struct {
|
|
|
|
Name string
|
|
|
|
Value string
|
2020-02-16 18:59:02 +00:00
|
|
|
}
|