dashboard

package
Version: v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 10 Imported by: 5

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) MarshalIndentJSON added in v0.17.0

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

MarshalIndentJSON renders the dashboard as indented JSON 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

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 as JSON 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 added in v0.5.1

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 added in v0.7.0

func Time(from, to string) Option

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

func Timezone added in v0.7.0

func Timezone(timezone TimezoneOption) Option

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

func UID added in v0.5.1

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 VariableAsDatasource added in v0.12.9

func VariableAsDatasource(name string, options ...datasource.Option) Option

VariableAsDatasource adds a templated variable, defined as a datasource. See https://grafana.com/docs/grafana/latest/variables/variable-types/add-data-source-variable/

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 added in v0.7.0

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.

Source Files

Jump to

Keyboard shortcuts

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