plugin

package
v1.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatasource

NewDatasource creates a new datasource instance.

Types

type Datasource

type Datasource struct {
	backend.CallResourceHandler
	// contains filtered or unexported fields
}

Datasource is an example datasource which can respond to data queries, reports its health and has streaming skills.

func (*Datasource) CheckHealth

CheckHealth handles health checks sent from Grafana to the plugin. The main use case for these health checks is the test button on the datasource configuration page which allows users to verify that a datasource is working as expected.

func (*Datasource) QueryData

QueryData handles multiple queries and returns multiple responses. req contains the queries []DataQuery (where each query contains RefID as a unique identifier). The QueryDataResponse contains a map of RefID to the response for each query, and each response contains Frames ([]*Frame).

type GetQueryResponse

type GetQueryResponse struct {
	Series struct {
		Time       []int64                 `json:"time"`
		SeriesMeta []api.QuerySeriesMetaV2 `json:"series_meta"`
		SeriesData [][]*float64            `json:"series_data"`
	} `json:"series"`
}

func (GetQueryResponse) MarshalEasyJSON

func (v GetQueryResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*GetQueryResponse) UnmarshalEasyJSON

func (v *GetQueryResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type Query

type Query struct {
	TopN       int64
	MetricName string
	TimeFrom   int64
	TimeTo     int64
	Interval   string
	Function   string
	What       []string
	GroupBy    []string
	Filters    []string
	Shifts     []int64
}

func (Query) GetURLParams

func (q Query) GetURLParams() url.Values

type ResourceHandler

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

type StatsHouseAPIHTTPClient

type StatsHouseAPIHTTPClient struct {
	URL string
	// contains filtered or unexported fields
}

func NewHTTPClient

func NewHTTPClient(url string, accessToken string, timeout time.Duration) StatsHouseAPIHTTPClient

func (StatsHouseAPIHTTPClient) GetMetric

func (c StatsHouseAPIHTTPClient) GetMetric(metricName string) (*api.MetricInfo, error)

func (StatsHouseAPIHTTPClient) GetMetricTagValues

func (c StatsHouseAPIHTTPClient) GetMetricTagValues(params url.Values) (*api.GetMetricTagValuesResp, error)

func (StatsHouseAPIHTTPClient) GetMetricsList

func (c StatsHouseAPIHTTPClient) GetMetricsList() (*api.GetMetricsListResp, error)

func (StatsHouseAPIHTTPClient) GetQuery

func (c StatsHouseAPIHTTPClient) GetQuery(params url.Values) (*GetQueryResponse, error)

type Tag

type Tag struct {
	ID          string `json:"id"`
	Description string `json:"description,omitempty"`
	IsRaw       bool   `json:"is_raw"`
}

Jump to

Keyboard shortcuts

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