Documentation
¶
Index ¶
Constants ¶
View Source
const ( // GrafanaFuncLabelNamesFuncName is the label_names function name in Grafana GrafanaFuncLabelNamesFuncName = "label_names" // GrafanaFuncLabelValuesFuncName is the label_values function name in Grafana GrafanaFuncLabelValuesFuncName = "label_values" // GrafanaFuncMetricNamesFuncName is the metrics function name in Grafana GrafanaFuncMetricNamesFuncName = "metrics" // GrafanaFuncQueryResultFuncName is the query_result function name in Grafana GrafanaFuncQueryResultFuncName = "query_result" )
Variables ¶
View Source
var ( // GrafanaFuncLabelNamesRegex is the label_names function in Grafana GrafanaFuncLabelNamesRegex = regexp.MustCompile(`^label_names\(\)\s*$`) // GrafanaFuncLabelNamesRegexWithMatch is the label_names function in Grafana GrafanaFuncLabelNamesRegexWithMatch = regexp.MustCompile(`^label_names\((.+)\)\s*$`) // GrafanaFuncLabelValuesRegex is the label_values function in Grafana GrafanaFuncLabelValuesRegex = regexp.MustCompile(`^label_values\((?:(.+),\s*)?([a-zA-Z_$][a-zA-Z0-9_]*)\)\s*$`) // GrafanaFuncMetricNamesRegex is the metrics function in Grafana GrafanaFuncMetricNamesRegex = regexp.MustCompile(`^metrics\((.+)\)\s*$`) // GrafanaFuncQueryResultRegex is the query_result function in Grafana GrafanaFuncQueryResultRegex = regexp.MustCompile(`^query_result\((.+)\)\s*$`) )
Functions ¶
This section is empty.
Types ¶
type Addon ¶
type Addon struct {
Measurement string
}
func (*Addon) BuildVariables ¶
func (addon *Addon) BuildVariables(variables []grafanaspec.VariableModel) ([]any, error)
BuildVariables builds variables for Guance Cloud All the function is described in https://github.com/grafana/grafana/blob/72d32eed27c058467aba8e02077b5b2e97c61c8d/public/app/plugins/datasource/prometheus/migrations/variableMigration.ts#L5
func (*Addon) PatchDashboard ¶
type GrafanaFuncLabelNames ¶ added in v0.2.3
type GrafanaFuncLabelNames struct {
MetricRegexp string
}
GrafanaFuncLabelNames is the label_names function in Grafana
func (*GrafanaFuncLabelNames) ToGuance ¶ added in v0.2.6
func (v *GrafanaFuncLabelNames) ToGuance() string
type GrafanaFuncLabelValues ¶ added in v0.2.3
GrafanaFuncLabelValues is the label_values function in Grafana
func (*GrafanaFuncLabelValues) ToGuance ¶ added in v0.2.6
func (v *GrafanaFuncLabelValues) ToGuance() string
type GrafanaFuncMetrics ¶ added in v0.2.3
type GrafanaFuncMetrics struct {
MetricRegexp string
}
GrafanaFuncMetrics is the metrics function in Grafana
func (*GrafanaFuncMetrics) ToGuance ¶ added in v0.2.6
func (v *GrafanaFuncMetrics) ToGuance() string
type GrafanaFuncQueryResult ¶ added in v0.2.3
GrafanaFuncQueryResult is the query_result function in Grafana
func (*GrafanaFuncQueryResult) ToGuance ¶ added in v0.2.6
func (v *GrafanaFuncQueryResult) ToGuance() string
type GrafanaVariable ¶ added in v0.2.3
GrafanaVariable is a struct to represent a variable load from Grafana
func (*GrafanaVariable) Func ¶ added in v0.2.3
func (v *GrafanaVariable) Func() (GrafanaVariableFunc, error)
type GrafanaVariableFunc ¶ added in v0.2.6
type GrafanaVariableFunc interface {
ToGuance() string
}
Click to show internal directories.
Click to hide internal directories.