Documentation ¶
Index ¶
- type Builder
- type Option
- func AutoRefresh(interval string) Option
- func DefaultTooltip() Option
- func Editable() Option
- func ID(id uint) Option
- func ReadOnly() Option
- func Row(title string, options ...row.Option) Option
- func SharedCrossHair() Option
- func Tags(tags []string) Option
- func TagsAnnotation(annotation TagAnnotation) Option
- func Time(from, to string) Option
- func Timezone(timezone TimezoneOption) Option
- func UID(uid string) Option
- func VariableAsConst(name string, options ...constant.Option) Option
- func VariableAsCustom(name string, options ...custom.Option) Option
- func VariableAsInterval(name string, options ...interval.Option) Option
- func VariableAsQuery(name string, options ...query.Option) Option
- type TagAnnotation
- type TimezoneOption
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 (*Builder) MarshalJSON ¶
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 ¶
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 SharedCrossHair ¶
func SharedCrossHair() Option
SharedCrossHair configures the graph tooltip to be shared across panels.
func TagsAnnotation ¶
func TagsAnnotation(annotation TagAnnotation) Option
TagsAnnotation adds a new source of annotation for the dashboard.
func Time ¶ added in v0.7.0
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 VariableAsConst ¶
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 ¶
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 ¶
VariableAsInterval adds a templated variable, defined as an interval. See https://grafana.com/docs/grafana/latest/reference/templating/#variable-types
func VariableAsQuery ¶
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.