Version: v0.0.0-...-d7e55e0 Latest Latest

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

Go to latest
Published: Nov 27, 2017 License: MIT Imports: 3 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Config

type Config struct {
	Rows []struct {
		Panels []PanelConfig `json:"panels"`
		Repeat string        `json:"repeat"`
		Title  string        `json:"title"`
	} `json:"rows"`
	Templating struct {
		List []struct {
			Name  string `json:"name"`
			Label string `json:"label"`
			Query string `json:"query"`
		} `json:"list"`
	} `json:"templating"`

Config is the Prometheus metrics config for the Grafana, We will parse the associated json file to this Config.

func ParseConfig

func ParseConfig(path string) (*Config, error)

ParseConfig parses the config from a JSON file.

func (*Config) LabelValues

func (c *Config) LabelValues() []LabelValue

LabelValues parse the templating to get the label values.

type LabelValue

type LabelValue struct {
	Query string
	Label string
	Name  string

LabelValue is used to get thet time series with the centain label. We will use this label value to replace the name configured in Grafana.

type PanelConfig

type PanelConfig struct {
	Targets []struct {
		Expr         string `json:"expr"`
		LegendFormat string `json:"legendFormat"`
	Title string `json:"title"`

PanelConfig is for panel of the row.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL