dashboard

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 7 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 {
	// contains filtered or unexported fields
}

Builder is the main builder used to configure dashboards.

func New

func New(title string, options ...Option) Builder

New creates a new dashboard builder.

func (*Builder) Internal

func (builder *Builder) Internal() *sdk.Board

Internal.

func (*Builder) MarshalJSON

func (builder *Builder) MarshalJSON() ([]byte, error)

MarshalJSON implements the encoding/json.Marshaler interface.

This method can be used to render the dashboard into a JSON file which your configuration management tool of choice can then feed into Grafana's dashboard via its provisioning support. See https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards

type Option

type Option func(dashboard *Builder)

Option represents an option that can be used to configure a dashboard.

func AutoRefresh

func AutoRefresh(interval string) Option

AutoRefresh defines the auto-refresh interval for the dashboard.

func DefaultTooltip

func DefaultTooltip() Option

DefaultTooltip configures the graph tooltip NOT to be shared across panels.

func Editable

func Editable() Option

Editable marks the dashboard as editable.

func ID

func ID(id uint) Option

ID sets the ID used by the dashboard.

func ReadOnly

func ReadOnly() Option

ReadOnly marks the dashboard as non-editable.

func Row

func Row(title string, options ...row.Option) Option

Row adds a row to the dashboard.

func SharedCrossHair

func SharedCrossHair() Option

SharedCrossHair configures the graph tooltip to be shared across panels.

func Tags

func Tags(tags []string) Option

Tags adds the given set of tags to the dashboard.

func TagsAnnotation

func TagsAnnotation(annotation TagAnnotation) Option

TagsAnnotation adds a new source of annotation for the dashboard.

func Time

func Time(from, to string) Option

Time defines the default time range for the dashboard, e.g. from "now-6h" to "now".

func Timezone

func Timezone(timezone TimezoneOption) Option

Timezone defines the default timezone for the dashboard, e.g. "utc".

func UID

func UID(uid string) Option

UID sets the UID used by the dashboard.

func VariableAsConst

func VariableAsConst(name string, options ...constant.Option) Option

VariableAsConst adds a templated variable, defined as a set of constant values. See https://grafana.com/docs/grafana/latest/reference/templating/#variable-types

func VariableAsCustom

func VariableAsCustom(name string, options ...custom.Option) Option

VariableAsCustom adds a templated variable, defined as a set of custom values. See https://grafana.com/docs/grafana/latest/reference/templating/#variable-types

func VariableAsInterval

func VariableAsInterval(name string, options ...interval.Option) Option

VariableAsInterval adds a templated variable, defined as an interval. See https://grafana.com/docs/grafana/latest/reference/templating/#variable-types

func VariableAsQuery

func VariableAsQuery(name string, options ...query.Option) Option

VariableAsQuery adds a templated variable, defined as a query. See https://grafana.com/docs/grafana/latest/reference/templating/#variable-types

type TagAnnotation

type TagAnnotation struct {
	Name       string
	Datasource string
	IconColor  string   `yaml:"color"`
	Tags       []string `yaml:",flow"`
}

TagAnnotation describes an annotation represented as a Tag. See https://grafana.com/docs/grafana/latest/reference/annotations/#query-by-tag

type TimezoneOption

type TimezoneOption string

TimezoneOption represents a possible value for the dashboard's timezone configuration.

const Browser TimezoneOption = "browser"

Browser sets the dashboard's timezone to the browser's one.

const DefaultTimezone TimezoneOption = ""

DefaultTimezone sets the dashboard's timezone to the default one used by Grafana.

const UTC TimezoneOption = "utc"

UTC sets the dashboard's timezone to UTC.

Jump to

Keyboard shortcuts

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