backends.go 495 B

123456789101112131415161718192021
  1. package graphite
  2. import (
  3. "fmt"
  4. m "github.com/grafana/grafana/pkg/models"
  5. )
  6. // AlertDatasource is bacon
  7. type AlertDatasource interface {
  8. GetSeries(job *m.AlertJob) (m.TimeSeriesSlice, error)
  9. }
  10. // GetSeries returns timeseries data from the datasource
  11. func GetSeries(job *m.AlertJob) (m.TimeSeriesSlice, error) {
  12. if job.Datasource.Type == m.DS_GRAPHITE {
  13. return GraphiteClient{}.GetSeries(job)
  14. }
  15. return nil, fmt.Errorf("Grafana does not support alerts for %s", job.Datasource.Type)
  16. }