grafana

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliGrafana

type AliGrafana struct {
}

AliGrafana implements Alibaba Cloud grafana query and range query methods.

func (AliGrafana) Query

func (ag AliGrafana) Query(ctx context.Context, addr, token, query string, options Options) ([]byte, error)

The Query method is used to query Alibaba Cloud grafana indicator data and return byte slices.

func (AliGrafana) QueryRange

func (ag AliGrafana) QueryRange(ctx context.Context, addr, token, query string, options Options) ([]byte, error)

The QueryRange method is used to query Alibaba Cloud grafana indicator data range and return byte slices.

type Datasource

type Datasource struct {
	Type string `json:"type"`
	UID  string `json:"uid"`
}

type Dimensions

type Dimensions struct {
	DomainName []string `json:"DomainName"`
	NodeID     []string `json:"NodeId"`
}

type Grafana

type Grafana struct {
}

Grafana implements open-source grafana query and range query methods.

func (Grafana) Query

func (ag Grafana) Query(ctx context.Context, addr, token, query string, _ Options) ([]byte, error)

The Query method is used to query open-source grafana indicator data and return byte slices.

func (Grafana) QueryRange

func (ag Grafana) QueryRange(ctx context.Context, addr, token, query string, options Options) ([]byte, error)

QueryRange implements Grafana.Query.

type MetricsInterface

type MetricsInterface interface {
	Query(ctx context.Context, addr, token, query string, options Options) ([]byte, error)
	QueryRange(ctx context.Context, addr, token, query string, options Options) ([]byte, error)
}

MetricsInterface is the interface that implements grafana metrics query and range query methods.

type Options

type Options struct {
	From int64
	To   int64
	Step int64
}

type Queries

type Queries struct {
	IntervalMs       int        `json:"intervalMs"`
	MaxDataPoints    int        `json:"maxDataPoints"`
	QueryMode        string     `json:"queryMode,omitempty"`
	Namespace        string     `json:"namespace,omitempty"`
	MetricName       string     `json:"metricName,omitempty"`
	Expression       string     `json:"expression,omitempty"`
	Dimensions       Dimensions `json:"dimensions,omitempty"`
	Region           string     `json:"region,omitempty"`
	ID               string     `json:"id,omitempty"`
	Alias            string     `json:"alias,omitempty"`
	Statistic        string     `json:"statistic,omitempty"`
	Period           string     `json:"period,omitempty"`
	MetricQueryType  int        `json:"metricQueryType,omitempty"`
	MetricEditorMode int        `json:"metricEditorMode,omitempty"`
	SQLExpression    string     `json:"sqlExpression,omitempty"`
	RefID            string     `json:"refId"`
	Key              string     `json:"key,omitempty"`
	Instant          bool       `json:"instant,omitempty"`
	Range            bool       `json:"range,omitempty"`
	MatchExact       bool       `json:"matchExact,omitempty"`
	Datasource       Datasource `json:"datasource"`
	Type             string     `json:"type,omitempty"`
	Exemplar         bool       `json:"exemplar,omitempty"`
	Expr             string     `json:"expr,omitempty"`
	Format           string     `json:"format,omitempty"`
	Interval         string     `json:"interval,omitempty"`
	IntervalFactor   int        `json:"intervalFactor,omitempty"`
	LegendFormat     string     `json:"legendFormat,omitempty"`
	Metric           string     `json:"metric,omitempty"`
	Step             int        `json:"step,omitempty"`
	QueryType        string     `json:"queryType,omitempty"`
	RequestID        string     `json:"requestId,omitempty"`
	UtcOffsetSec     int        `json:"utcOffsetSec,omitempty"`
	DatasourceID     int        `json:"datasourceId,omitempty"`
	RawSQL           string     `json:"rawSql,omitempty"`
}

type Range

type Range struct {
	From time.Time `json:"from"`
	To   time.Time `json:"to"`
	Raw  Raw       `json:"raw"`
}

type Raw

type Raw struct {
	From string `json:"from"`
	To   string `json:"to"`
}

Jump to

Keyboard shortcuts

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