plugin

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DmCache = DimensionCache{MetaCache{
	Data: sync.Map{},
}}
View Source
var GetMeta = initMetaConf()
View Source
var MCache = MetricCache{MetaCache{
	Data: sync.Map{},
}}
View Source
var NsCache = NamespaceCache{MetaCache{
	Data: sync.Map{},
}}

Functions

func GetCESClient

func GetCESClient(c *CloudEyeSettings) *ces.CesClient

func LoadDimensions

func LoadDimensions(region, namespace string) []string

func LoadMetrics

func LoadMetrics(namespace, dimStr string) []string

func NewCloudEye

func NewCloudEye() datasource.ServeOpts

NewCloudEye returns datasource.ServeOpts.

Types

type CESClient

type CESClient struct {
	Client *ces.CesClient
	Region string
}

func (*CESClient) BatchQuery

func (*CESClient) Check

func (c *CESClient) Check() error

func (*CESClient) ListDims

func (c *CESClient) ListDims(namespace string) []string

func (*CESClient) ListMeta

func (c *CESClient) ListMeta(param *QueryParam) []string

func (*CESClient) ListMetrics

func (c *CESClient) ListMetrics(namespace, dimStr string) []string

func (*CESClient) ListNamespaces

func (c *CESClient) ListNamespaces() []string

type CachedMeta

type CachedMeta struct {
	Name       string
	Meta       []string
	Finished   bool // 是否查完
	Marker     string
	TTL        int64
	UpdateTime int64
}

type CloudEyeDatasource

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

func (*CloudEyeDatasource) 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 (*CloudEyeDatasource) QueryData

type CloudEyeSettings

type CloudEyeSettings struct {
	ProjectID       string `json:"projectId"`
	CESEndpoint     string `json:"cesEndpoint"`
	Region          string `json:"region"`
	MetaConfEnabled bool   `json:"metaConfEnabled"`
	AK              string `json:"accessKey"`
	SK              string `json:"secretKey"`
}

func LoadSettings

func LoadSettings(ctx backend.PluginContext) (*CloudEyeSettings, error)

type CustomBatchListMetricDataRequestBody

type CustomBatchListMetricDataRequestBody struct {
	model.BatchListMetricDataRequestBody
	RefIDs []string `json:"refIDs"`
	Region string   `json:"region"`
}

type DataQueryParam

type DataQueryParam struct {
	Region     string
	Namespace  string
	DimStr     string
	MetricName string
	Filter     string
	Period     string
	From       int64
	To         int64
	RefID      string
}

type DimensionCache

type DimensionCache struct {
	MetaCache
}

type MetaCache

type MetaCache struct {
	Data sync.Map // key: string, value: CachedMeta
}

type MetaConf

type MetaConf struct {
	Regions    []string                       `yaml:"regions"`
	Namespaces map[string][]string            `yaml:"namespaces"` // key: region, value: namespaceList
	Dimensions map[string]map[string][]string `yaml:"dimensions"` // key: region|namespace, value: map[dimKey]dimValues
	Metrics    map[string][]string            `yaml:"metrics"`    // key: namespace|dimKey, value: metrics
}

type MetaUtil

type MetaUtil interface {
	// contains filtered or unexported methods
}

type MetricCache

type MetricCache struct {
	MetaCache
}

type NamespaceCache

type NamespaceCache struct {
	MetaCache
}

type QueryParam

type QueryParam struct {
	Region    string
	Namespace string
	DimStr    string
}

Jump to

Keyboard shortcuts

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