prometheus

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Measurement string
	ChartType   string
}

Builder is the builder to convert Prometheus from Grafana Dashboard to Guance Cloud

func (*Builder) BuildTargets

func (builder *Builder) BuildTargets(targets []grafanaspec.Target) ([]any, error)

BuildTargets builds targets for Guance Cloud

func (*Builder) BuildVariables

func (builder *Builder) BuildVariables(variables []grafanaspec.VariableModel) ([]any, error)

BuildVariables builds variables for Guance Cloud

type Rewriter

type Rewriter struct {
	Measurement string
}

Rewriter is a rewriter to convert Grafana-specific PromQL to MetricsQL on Guance Cloud

func (*Rewriter) Rewrite

func (w *Rewriter) Rewrite(query string) (string, error)

Rewrite will rewrite a query from Grafana-specific PromQL to MetricsQL on Guance Cloud

func (*Rewriter) Visit

func (w *Rewriter) Visit(node parser.Node, path []parser.Node) (v parser.Visitor, err error)

type Target

type Target struct {
	Datasource   any    `json:"datasource"`
	Expr         string `json:"expr"`
	Hide         bool   `json:"hide"`
	Interval     string `json:"interval"`
	LegendFormat string `json:"legendFormat"`
	RefID        string `json:"refId"`
}

Target is the query target of Grafana

Jump to

Keyboard shortcuts

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