Documentation ¶
Index ¶
- type Builder
- type DashboardLink
- type ExternalLink
- type LinkIcon
- type Option
- func AutoRefresh(interval string) Option
- func DashboardLinks(links ...DashboardLink) Option
- func DefaultTooltip() Option
- func Editable() Option
- func ExternalLinks(links ...ExternalLink) Option
- func ID(id uint) Option
- func ReadOnly() Option
- func Row(title string, options ...row.Option) Option
- func SharedCrossHair() Option
- func Slug(slug string) 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 VariableAsDatasource(name string, options ...datasource.Option) Option
- func VariableAsInterval(name string, options ...interval.Option) Option
- func VariableAsQuery(name string, options ...query.Option) Option
- func VariableAsText(name string, options ...text.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) MarshalIndentJSON ¶ added in v0.17.0
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 ¶
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 DashboardLink ¶ added in v0.21.14
type DashboardLink struct { Title string Tags []string AsDropdown bool IncludeTimeRange bool IncludeVariableValues bool OpenInNewTab bool }
DashboardLink describes dashboard-level links to other dashboards. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/manage-dashboard-links/#dashboard-links
type ExternalLink ¶ added in v0.17.4
type ExternalLink struct { Title string Description string URL string Icon LinkIcon IncludeTimeRange bool IncludeVariableValues bool OpenInNewTab bool }
ExternalLink describes dashboard-level external link. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/manage-dashboard-links/#add-a-url-link-to-a-dashboard
type Option ¶
Option represents an option that can be used to configure a dashboard.
func AutoRefresh ¶
AutoRefresh defines the auto-refresh interval for the dashboard.
func DashboardLinks ¶ added in v0.21.14
func DashboardLinks(links ...DashboardLink) Option
DashboardLinks adds a dashboard-level links to other dashboards. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/manage-dashboard-links/#dashboard-links
func DefaultTooltip ¶
func DefaultTooltip() Option
DefaultTooltip configures the graph tooltip NOT to be shared across panels.
func ExternalLinks ¶ added in v0.17.4
func ExternalLinks(links ...ExternalLink) Option
ExternalLinks adds a dashboard-level external links. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/manage-dashboard-links/#add-a-url-link-to-a-dashboard
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 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 ¶
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
func VariableAsText ¶ added in v0.21.16
VariableAsText adds a templated variable, defined as a free text input. See https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/#add-a-text-box-variable
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.