Documentation ¶
Index ¶
- Constants
- func Bool(b bool) *bool
- func Int64(i int64) *int64
- type Alert
- type AlertCondition
- type AlertEvaluator
- type AlertOperator
- type AlertQuery
- type AlertReducer
- type AlertlistPanel
- type Annotation
- type Axis
- type BarGaugePanel
- type Board
- type BoolInt
- type BoolString
- type Column
- type ColumnStyle
- type CommonPanel
- type Current
- type CustomPanel
- type DashlistPanel
- type Datasource
- type DatasourceType
- type FieldConfig
- type FieldConfigColor
- type FieldConfigCustom
- type FieldConfigDefaults
- type FloatString
- type Gauge
- type GraphPanel
- type GridPos
- type HeatmapPanel
- type Height
- type IntString
- type Legend
- type Link
- type MapType
- type Matcher
- type NewsOptions
- type NewsPanel
- type Option
- type Options
- type Override
- type Panel
- func NewAlertlist(title string) *Panel
- func NewCustom(title string) *Panel
- func NewDashlist(title string) *Panel
- func NewGraph(title string) *Panel
- func NewHeatmap(title string) *Panel
- func NewNews(title string) *Panel
- func NewPluginlist(title string) *Panel
- func NewSinglestat(title string) *Panel
- func NewStat(title string) *Panel
- func NewTable(title string) *Panel
- func NewText(title string) *Panel
- func NewTimeseries(title string) *Panel
- type PluginlistPanel
- type Property
- type RangeMap
- type RowPanel
- type SeriesOverride
- type SinglestatPanel
- type Sort
- type SparkLine
- type StackdriverAlignOption
- type StackdriverAlignOptions
- type StatPanel
- type StringSliceString
- type TablePanel
- type Target
- type TemplateVar
- type Templating
- type TextPanel
- type Threshold
- type ThresholdStep
- type Thresholds
- type Time
- type Timepicker
- type TimeseriesLegendOptions
- type TimeseriesOptions
- type TimeseriesPanel
- type TimeseriesTooltipOptions
- type Tooltip
- type ValueMap
Constants ¶
const ( TemplatingHideNone = iota TemplatingHideLabel TemplatingHideVariable )
Constants for templating
const ( CustomType panelType = iota DashlistType GraphType TableType TextType PluginlistType AlertlistType SinglestatType StatType RowType BarGaugeType HeatmapType TimeseriesType NewsType )
Each panel may be one of these types.
const MixedSource = "-- Mixed --"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Alert ¶
type Alert struct { AlertRuleTags map[string]string `json:"alertRuleTags,omitempty"` Conditions []AlertCondition `json:"conditions,omitempty"` ExecutionErrorState string `json:"executionErrorState,omitempty"` Frequency string `json:"frequency,omitempty"` Handler int `json:"handler,omitempty"` Name string `json:"name,omitempty"` NoDataState string `json:"noDataState,omitempty"` Message string `json:"message,omitempty"` For string `json:"for,omitempty"` }
type AlertCondition ¶
type AlertCondition struct { Evaluator AlertEvaluator `json:"evaluator,omitempty"` Operator AlertOperator `json:"operator,omitempty"` Query AlertQuery `json:"query,omitempty"` Reducer AlertReducer `json:"reducer,omitempty"` Type string `json:"type,omitempty"` }
type AlertEvaluator ¶
type AlertOperator ¶
type AlertOperator struct {
Type string `json:"type,omitempty"`
}
type AlertQuery ¶
type AlertQuery struct {
Params []string `json:"params,omitempty"`
}
type AlertReducer ¶
type AlertlistPanel ¶
type AlertlistPanel struct { OnlyAlertsOnDashboard bool `json:"onlyAlertsOnDashboard"` Show string `json:"show"` SortOrder int `json:"sortOrder"` Limit int `json:"limit"` StateFilter []string `json:"stateFilter"` NameFilter string `json:"nameFilter,omitempty"` DashboardTags []string `json:"dashboardTags,omitempty"` }
type Annotation ¶
type Annotation struct { Name string `json:"name"` Datasource interface{} `json:"datasource"` ShowLine bool `json:"showLine"` IconColor string `json:"iconColor"` LineColor string `json:"lineColor"` IconSize uint `json:"iconSize"` Enable bool `json:"enable"` Query string `json:"query"` Expr string `json:"expr"` Step string `json:"step"` TextField string `json:"textField"` TextFormat string `json:"textFormat"` TitleFormat string `json:"titleFormat"` TagsField string `json:"tagsField"` Tags []string `json:"tags"` TagKeys string `json:"tagKeys"` Type string `json:"type"` }
type Axis ¶
type Axis struct { Format string `json:"format"` LogBase int `json:"logBase"` Decimals int `json:"decimals,omitempty"` Max *FloatString `json:"max,omitempty"` Min *FloatString `json:"min,omitempty"` Show bool `json:"show"` Label string `json:"label,omitempty"` }
for a graph panel
type BarGaugePanel ¶
type BarGaugePanel struct { Options Options `json:"options"` Targets []Target `json:"targets,omitempty"` FieldConfig FieldConfig `json:"fieldConfig"` }
type Board ¶
type Board struct { // ID uint `json:"id,omitempty"`, let grafana set this on seeing the dashboard. UID string `json:"uid,omitempty"` Slug string `json:"slug"` Title string `json:"title"` OriginalTitle string `json:"originalTitle"` Tags []string `json:"tags"` Style string `json:"style"` Timezone string `json:"timezone"` Editable bool `json:"editable"` HideControls bool `json:"hideControls" graf:"hide-controls"` Panels []*Panel `json:"panels"` Templating Templating `json:"templating"` Annotations struct { List []Annotation `json:"list"` } `json:"annotations"` Refresh *BoolString `json:"refresh,omitempty"` SchemaVersion uint `json:"schemaVersion"` Version uint `json:"version"` Links []Link `json:"links"` Time Time `json:"time"` Timepicker *Timepicker `json:"timepicker,omitempty"` GraphTooltip int `json:"graphTooltip,omitempty"` }
Board represents Grafana dashboard.
func (*Board) RemoveTags ¶
func (*Board) UpdateSlug ¶
type BoolString ¶
func (BoolString) MarshalJSON ¶
func (s BoolString) MarshalJSON() ([]byte, error)
func (*BoolString) UnmarshalJSON ¶
func (s *BoolString) UnmarshalJSON(raw []byte) error
type ColumnStyle ¶
type ColumnStyle struct { Alias *string `json:"alias"` DateFormat *string `json:"dateFormat,omitempty"` Pattern string `json:"pattern"` Type string `json:"type"` ColorMode *string `json:"colorMode,omitempty"` Colors *[]string `json:"colors,omitempty"` Decimals *int `json:"decimals,omitempty"` Thresholds *[]string `json:"thresholds,omitempty"` Unit *string `json:"unit,omitempty"` MappingType int `json:"mappingType,omitempty"` ValueMaps []ValueMap `json:"valueMaps,omitempty"` Link bool `json:"link,omitempty"` LinkTooltip *string `json:"linkTooltip,omitempty"` LinkUrl *string `json:"linkUrl,omitempty"` LinkTargetBlank bool `json:"linkTargetBlank,omitempty"` }
for a table
type CommonPanel ¶
type CommonPanel struct { Datasource interface{} `json:"datasource,omitempty"` // metrics Editable bool `json:"editable"` Error bool `json:"error"` GridPos GridPos `json:"gridPos,omitempty"` Height interface{} `json:"height,omitempty"` // general HideTimeOverride *bool `json:"hideTimeOverride,omitempty"` ID uint `json:"id"` IsNew bool `json:"isNew"` Links []Link `json:"links,omitempty"` // general MinSpan *float32 `json:"minSpan,omitempty"` // templating options OfType panelType `json:"-"` // it required for defining type of the panel Renderer *string `json:"renderer,omitempty"` // display styles Repeat *string `json:"repeat,omitempty"` // templating options // RepeatIteration *int64 `json:"repeatIteration,omitempty"` RepeatPanelID *uint `json:"repeatPanelId,omitempty"` ScopedVars map[string]struct { Selected bool `json:"selected"` Text string `json:"text"` Value string `json:"value"` } `json:"scopedVars,omitempty"` Title string `json:"title"` // general Description *string `json:"description,omitempty"` // general Transparent bool `json:"transparent"` Type string `json:"type"` Alert *Alert `json:"alert,omitempty"` }
type Current ¶
type Current struct { Tags []string `json:"tags,omitempty"` Text *StringSliceString `json:"text"` Value interface{} `json:"value"` // TODO select more precise type }
for templateVar
type CustomPanel ¶
type CustomPanel map[string]interface{}
type DashlistPanel ¶
type Datasource ¶
type Datasource struct { ID uint `json:"id"` OrgID uint `json:"orgId"` UID string `json:"uid"` Name string `json:"name,omitempty"` Type string `json:"type"` TypeLogoURL string `json:"typeLogoUrl,omitempty"` Access string `json:"access,omitempty"` // direct or proxy URL string `json:"url,omitempty"` Password *string `json:"password,omitempty"` User *string `json:"user,omitempty"` Database *string `json:"database,omitempty"` BasicAuth *bool `json:"basicAuth,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` BasicAuthUser *string `json:"basicAuthUser,omitempty"` BasicAuthPassword *string `json:"basicAuthPassword,omitempty"` IsDefault bool `json:"isDefault"` JSONData interface{} `json:"jsonData,omitempty"` SecureJSONData interface{} `json:"secureJsonData,omitempty"` }
Datasource as described in the doc http://docs.grafana.org/reference/http_api/#get-all-datasources
type DatasourceType ¶
type DatasourceType struct { Metrics bool `json:"metrics"` Module string `json:"module"` Name string `json:"name"` Partials struct { Query string `json:"query"` } `json:"datasource"` PluginType string `json:"pluginType"` ServiceName string `json:"serviceName"` Type string `json:"type"` }
Datasource type as described in http://docs.grafana.org/reference/http_api/#available-data-source-types
type FieldConfig ¶
type FieldConfig struct { Defaults FieldConfigDefaults `json:"defaults"` Overrides []Override `json:"overrides"` }
type FieldConfigColor ¶
type FieldConfigCustom ¶
type FieldConfigCustom struct { AxisLabel string `json:"axisLabel,omitempty"` AxisPlacement string `json:"axisPlacement"` AxisSoftMin *int `json:"axisSoftMin,omitempty"` AxisSoftMax *int `json:"axisSoftMax,omitempty"` BarAlignment int `json:"barAlignment"` DrawStyle string `json:"drawStyle"` FillOpacity int `json:"fillOpacity"` GradientMode string `json:"gradientMode"` LineInterpolation string `json:"lineInterpolation"` LineWidth int `json:"lineWidth"` PointSize int `json:"pointSize"` ShowPoints string `json:"showPoints"` SpanNulls bool `json:"spanNulls"` HideFrom struct { Legend bool `json:"legend"` Tooltip bool `json:"tooltip"` Viz bool `json:"viz"` } `json:"hideFrom"` LineStyle struct { Fill string `json:"fill"` } `json:"lineStyle"` ScaleDistribution struct { Type string `json:"type"` Log int `json:"log,omitempty"` } `json:"scaleDistribution"` Stacking struct { Group string `json:"group"` Mode string `json:"mode"` } `json:"stacking"` ThresholdsStyle struct { Mode string `json:"mode"` } `json:"thresholdsStyle"` }
type FieldConfigDefaults ¶
type FieldConfigDefaults struct { Unit string `json:"unit,omitempty"` Decimals *int `json:"decimals,omitempty"` Min *float64 `json:"min,omitempty"` Max *float64 `json:"max,omitempty"` Color *FieldConfigColor `json:"color,omitempty"` Thresholds Thresholds `json:"thresholds,omitempty"` Custom *FieldConfigCustom `json:"custom,omitempty"` Links []Link `json:"links,omitempty"` }
type FloatString ¶
FloatString represents special type for json values that could be strings or ints: 100 or "100"
func NewFloatString ¶
func NewFloatString(i float64) *FloatString
func (*FloatString) MarshalJSON ¶
func (v *FloatString) MarshalJSON() ([]byte, error)
MarshalJSON implements custom marshalling for FloatString type
func (*FloatString) UnmarshalJSON ¶
func (v *FloatString) UnmarshalJSON(raw []byte) error
UnmarshalJSON implements custom unmarshalling for FloatString type
type Gauge ¶
type Gauge struct { MaxValue float32 `json:"maxValue"` MinValue float32 `json:"minValue"` Show bool `json:"show"` ThresholdLabels bool `json:"thresholdLabels"` ThresholdMarkers bool `json:"thresholdMarkers"` }
for a stat
type GraphPanel ¶
type GraphPanel struct { AliasColors interface{} `json:"aliasColors"` // XXX Bars bool `json:"bars"` DashLength *uint `json:"dashLength,omitempty"` Dashes *bool `json:"dashes,omitempty"` Decimals *int `json:"decimals,omitempty"` Fill int `json:"fill"` Legend Legend `json:"legend,omitempty"` LeftYAxisLabel *string `json:"leftYAxisLabel,omitempty"` Lines bool `json:"lines"` Linewidth uint `json:"linewidth"` NullPointMode string `json:"nullPointMode"` Percentage bool `json:"percentage"` Pointradius float32 `json:"pointradius"` Points bool `json:"points"` RightYAxisLabel *string `json:"rightYAxisLabel,omitempty"` SeriesOverrides []SeriesOverride `json:"seriesOverrides,omitempty"` SpaceLength *uint `json:"spaceLength,omitempty"` Stack bool `json:"stack"` SteppedLine bool `json:"steppedLine"` Targets []Target `json:"targets,omitempty"` Thresholds []Threshold `json:"thresholds,omitempty"` TimeFrom *string `json:"timeFrom,omitempty"` TimeShift *string `json:"timeShift,omitempty"` Tooltip Tooltip `json:"tooltip"` XAxis bool `json:"x-axis,omitempty"` YAxis bool `json:"y-axis,omitempty"` YFormats []string `json:"y_formats,omitempty"` Xaxis Axis `json:"xaxis"` // was added in Grafana 4.x? Yaxes []Axis `json:"yaxes"` // was added in Grafana 4.x? FieldConfig *FieldConfig `json:"fieldConfig,omitempty"` }
type GridPos ¶
type GridPos struct { H *int `json:"h,omitempty"` W *int `json:"w,omitempty"` X *int `json:"x,omitempty"` Y *int `json:"y,omitempty"` }
for a graph panel
type HeatmapPanel ¶
type HeatmapPanel struct { Cards struct { CardPadding *float64 `json:"cardPadding"` CardRound *float64 `json:"cardRound"` } `json:"cards"` Color struct { CardColor string `json:"cardColor"` ColorScale string `json:"colorScale"` ColorScheme string `json:"colorScheme"` Exponent float64 `json:"exponent"` Min *float64 `json:"min,omitempty"` Max *float64 `json:"max,omitempty"` Mode string `json:"mode"` } `json:"color"` DataFormat string `json:"dataFormat"` HideZeroBuckets bool `json:"hideZeroBuckets"` HighlightCards bool `json:"highlightCards"` Legend struct { Show bool `json:"show"` } `json:"legend"` ReverseYBuckets bool `json:"reverseYBuckets"` Targets []Target `json:"targets,omitempty"` Tooltip struct { Show bool `json:"show"` ShowHistogram bool `json:"showHistogram"` } `json:"tooltip"` TooltipDecimals int `json:"tooltipDecimals"` XAxis struct { Show bool `json:"show"` } `json:"xAxis"` XBucketNumber *float64 `json:"xBucketNumber"` XBucketSize *string `json:"xBucketSize"` YAxis struct { Decimals *int `json:"decimals"` Format string `json:"format"` LogBase int `json:"logBase"` Show bool `json:"show"` Max *string `json:"max"` Min *string `json:"min"` SplitFactor *float64 `json:"splitFactor"` } `json:"yAxis"` YBucketBound string `json:"yBucketBound"` YBucketNumber *float64 `json:"yBucketNumber"` YBucketSize *float64 `json:"yBucketSize"` }
type Height ¶
type Height string
Height of rows maybe passed as number (ex 200) or as string (ex "200px") or empty string
func (*Height) UnmarshalJSON ¶
type IntString ¶
IntString represents special type for json values that could be strings or ints: 100 or "100"
func NewIntString ¶
func (*IntString) MarshalJSON ¶
MarshalJSON implements custom marshalling for IntString type
func (*IntString) UnmarshalJSON ¶
UnmarshalJSON implements custom unmarshalling for IntString type
type Legend ¶
type Legend struct { AlignAsTable bool `json:"alignAsTable"` Avg bool `json:"avg"` Current bool `json:"current"` HideEmpty bool `json:"hideEmpty"` HideZero bool `json:"hideZero"` Max bool `json:"max"` Min bool `json:"min"` RightSide bool `json:"rightSide"` Show bool `json:"show"` SideWidth *uint `json:"sideWidth,omitempty"` Total bool `json:"total"` Values bool `json:"values"` }
for a graph panel
type Link ¶
type Link struct { Title string `json:"title"` Type string `json:"type"` AsDropdown *bool `json:"asDropdown,omitempty"` DashURI *string `json:"dashUri,omitempty"` Dashboard *string `json:"dashboard,omitempty"` Icon *string `json:"icon,omitempty"` IncludeVars bool `json:"includeVars"` KeepTime *bool `json:"keepTime,omitempty"` Params *string `json:"params,omitempty"` Tags []string `json:"tags,omitempty"` TargetBlank *bool `json:"targetBlank,omitempty"` Tooltip *string `json:"tooltip,omitempty"` URL *string `json:"url,omitempty"` }
Link represents link to another dashboard or external weblink
type NewsOptions ¶
type NewsOptions struct {
FeedUrl string `json:"feedUrl"`
}
type NewsPanel ¶
type NewsPanel struct {
Options NewsOptions `json:"options"`
}
type Option ¶
type Option struct { Text string `json:"text"` Value string `json:"value"` Selected bool `json:"selected"` }
for templateVar
type Options ¶
type Options struct { Orientation string `json:"orientation"` TextMode string `json:"textMode"` ColorMode string `json:"colorMode"` GraphMode string `json:"graphMode"` JustifyMode string `json:"justifyMode"` DisplayMode string `json:"displayMode"` Content string `json:"content"` Mode string `json:"mode"` ReduceOptions struct { Values bool `json:"values"` Fields string `json:"fields"` Calcs []string `json:"calcs"` } `json:"reduceOptions"` }
type Panel ¶
type Panel struct { CommonPanel // Should be initialized only one type of panels. // OfType field defines which of types below will be used. *GraphPanel *TablePanel *TextPanel *SinglestatPanel *StatPanel *DashlistPanel *PluginlistPanel *RowPanel *AlertlistPanel *BarGaugePanel *HeatmapPanel *TimeseriesPanel *CustomPanel *NewsPanel }
Panel represents panels of different types defined in Grafana.
func NewAlertlist ¶
func NewDashlist ¶
NewDashlist initializes panel with a dashlist panel.
func NewHeatmap ¶
func NewPluginlist ¶
NewPluginlist initializes panel with a stat panel.
func NewSinglestat ¶
NewSinglestat initializes panel with a singlestat panel.
func NewTimeseries ¶
NewTimeseries initializes panel with a timeseries panel.
func (*Panel) AddTarget ¶
AddTarget adds a new target as defined in the argument but with refId letter incremented. Value of refID from the argument will be used only if no target with such value already exists.
func (*Panel) GetTargets ¶
GetTargets is iterate over all panel targets. It just returns nil if no targets defined for panel of concrete type.
func (*Panel) MarshalJSON ¶
func (*Panel) SetTarget ¶
SetTarget updates a target if target with such refId exists or creates a new one.
func (*Panel) UnmarshalJSON ¶
type PluginlistPanel ¶
type PluginlistPanel struct {
Limit int `json:"limit,omitempty"`
}
type SeriesOverride ¶
type SeriesOverride struct { Alias string `json:"alias"` Bars *bool `json:"bars,omitempty"` Color *string `json:"color,omitempty"` Dashes *bool `json:"dashes,omitempty"` Fill *int `json:"fill,omitempty"` FillBelowTo *string `json:"fillBelowTo,omitempty"` Legend *bool `json:"legend,omitempty"` Lines *bool `json:"lines,omitempty"` LineWidth *int `json:"linewidth,omitempty"` Stack *BoolString `json:"stack,omitempty"` Transform *string `json:"transform,omitempty"` YAxis *int `json:"yaxis,omitempty"` ZIndex *int `json:"zindex,omitempty"` NullPointMode *string `json:"nullPointMode,omitempty"` }
for a graph panel
type SinglestatPanel ¶
type SinglestatPanel struct { Colors []string `json:"colors"` ColorValue bool `json:"colorValue"` ColorBackground bool `json:"colorBackground"` Decimals int `json:"decimals"` Format string `json:"format"` Gauge Gauge `json:"gauge,omitempty"` MappingType *uint `json:"mappingType,omitempty"` MappingTypes []*MapType `json:"mappingTypes,omitempty"` MaxDataPoints *IntString `json:"maxDataPoints,omitempty"` NullPointMode string `json:"nullPointMode"` Postfix *string `json:"postfix,omitempty"` PostfixFontSize *string `json:"postfixFontSize,omitempty"` Prefix *string `json:"prefix,omitempty"` PrefixFontSize *string `json:"prefixFontSize,omitempty"` RangeMaps []*RangeMap `json:"rangeMaps,omitempty"` SparkLine SparkLine `json:"sparkline,omitempty"` Targets []Target `json:"targets,omitempty"` Thresholds string `json:"thresholds"` ValueFontSize string `json:"valueFontSize"` ValueMaps []ValueMap `json:"valueMaps"` ValueName string `json:"valueName"` }
type SparkLine ¶
type SparkLine struct { FillColor *string `json:"fillColor,omitempty"` Full bool `json:"full,omitempty"` LineColor *string `json:"lineColor,omitempty"` Show bool `json:"show,omitempty"` YMin *float64 `json:"ymin,omitempty"` YMax *float64 `json:"ymax,omitempty"` }
for a stat
type StackdriverAlignOption ¶
type StackdriverAlignOption struct { Label string `json:"label"` MetricKinds []string `json:"metricKinds"` Text string `json:"text"` Value string `json:"value"` ValueTypes []string `json:"valueTypes"` }
StackdriverAlignOption defines a single alignment option shown in Grafana during query configuration.
type StackdriverAlignOptions ¶
type StackdriverAlignOptions struct { Expanded bool `json:"expanded"` Label string `json:"label"` Options []StackdriverAlignOption `json:"options"` }
StackdriverAlignOptions defines the list of alignment options shown in Grafana during query configuration.
type StatPanel ¶
type StatPanel struct { Colors []string `json:"colors,omitempty"` ColorValue bool `json:"colorValue"` ColorBackground bool `json:"colorBackground"` Decimals int `json:"decimals"` Format string `json:"format"` Gauge Gauge `json:"gauge,omitempty"` MappingType *uint `json:"mappingType,omitempty"` MappingTypes []*MapType `json:"mappingTypes,omitempty"` MaxDataPoints *IntString `json:"maxDataPoints,omitempty"` NullPointMode string `json:"nullPointMode"` Postfix *string `json:"postfix,omitempty"` PostfixFontSize *string `json:"postfixFontSize,omitempty"` Prefix *string `json:"prefix,omitempty"` PrefixFontSize *string `json:"prefixFontSize,omitempty"` RangeMaps []*RangeMap `json:"rangeMaps,omitempty"` SparkLine SparkLine `json:"sparkline,omitempty"` Targets []Target `json:"targets,omitempty"` Thresholds string `json:"thresholds"` ValueFontSize string `json:"valueFontSize"` ValueMaps []ValueMap `json:"valueMaps,omitempty"` ValueName string `json:"valueName"` FieldConfig FieldConfig `json:"fieldConfig,omitempty"` // need subset Options Options `json:"options"` }
type StringSliceString ¶
StringSliceString represents special type for json values that could be strings or slice of strings: "something" or ["something"].
func (*StringSliceString) MarshalJSON ¶
func (v *StringSliceString) MarshalJSON() ([]byte, error)
MarshalJSON implements custom marshalling for StringSliceString type.
func (*StringSliceString) UnmarshalJSON ¶
func (v *StringSliceString) UnmarshalJSON(raw []byte) error
UnmarshalJSON implements custom unmarshalling for StringSliceString type.
type TablePanel ¶
type Target ¶
type Target struct { RefID string `json:"refId"` Datasource interface{} `json:"datasource,omitempty"` Hide bool `json:"hide,omitempty"` // For PostgreSQL Table string `json:"table,omitempty"` TimeColumn string `json:"timeColumn,omitempty"` MetricColumn string `json:"metricColumn,omitempty"` RawSql string `json:"rawSql,omitempty"` Select [][]struct { Params []string `json:"params,omitempty"` Type string `json:"type,omitempty"` } `json:"select,omitempty"` Where []struct { Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` Params []string `json:"params,omitempty"` Datatype string `json:"datatype,omitempty"` } `json:"where,omitempty"` Group []struct { Type string `json:"type,omitempty"` Params []string `json:"params,omitempty"` } `json:"group,omitempty"` // For Prometheus Expr string `json:"expr,omitempty"` IntervalFactor int `json:"intervalFactor,omitempty"` Interval string `json:"interval,omitempty"` Step int `json:"step,omitempty"` LegendFormat string `json:"legendFormat,omitempty"` Instant bool `json:"instant,omitempty"` Format string `json:"format,omitempty"` // For InfluxDB Measurement string `json:"measurement,omitempty"` // For Elasticsearch DsType *string `json:"dsType,omitempty"` Metrics []struct { ID string `json:"id"` Field string `json:"field"` Type string `json:"type"` } `json:"metrics,omitempty"` Query string `json:"query,omitempty"` Alias string `json:"alias,omitempty"` RawQuery bool `json:"rawQuery,omitempty"` TimeField string `json:"timeField,omitempty"` BucketAggs []struct { ID string `json:"id"` Field string `json:"field"` Type string `json:"type"` Settings struct { Interval string `json:"interval,omitempty"` MinDocCount interface{} `json:"min_doc_count"` Order string `json:"order,omitempty"` OrderBy string `json:"orderBy,omitempty"` Size string `json:"size,omitempty"` } `json:"settings"` } `json:"bucketAggs,omitempty"` // For Graphite Target string `json:"target,omitempty"` // For CloudWatch Namespace string `json:"namespace,omitempty"` MetricName string `json:"metricName,omitempty"` Statistics []string `json:"statistics,omitempty"` Dimensions map[string]string `json:"dimensions,omitempty"` Period string `json:"period,omitempty"` Region string `json:"region,omitempty"` // For the Stackdriver data source. Find out more information at // https:/grafana.com/docs/grafana/v6.0/features/datasources/stackdriver/ ProjectName string `json:"projectName,omitempty"` AlignOptions []StackdriverAlignOptions `json:"alignOptions,omitempty"` AliasBy string `json:"aliasBy,omitempty"` MetricType string `json:"metricType,omitempty"` MetricKind string `json:"metricKind,omitempty"` Filters []string `json:"filters,omitempty"` AlignmentPeriod string `json:"alignmentPeriod,omitempty"` CrossSeriesReducer string `json:"crossSeriesReducer,omitempty"` PerSeriesAligner string `json:"perSeriesAligner,omitempty"` ValueType string `json:"valueType,omitempty"` GroupBy []string `json:"groupBy,omitempty"` Tags []struct { Key string `json:"key,omitempty"` Operator string `json:"operator,omitempty"` Value string `json:"value,omitempty"` } `json:"tags,omitempty"` }
for an any panel
type TemplateVar ¶
type TemplateVar struct { Name string `json:"name"` Type string `json:"type"` Auto bool `json:"auto,omitempty"` AutoCount *int `json:"auto_count,omitempty"` Datasource interface{} `json:"datasource"` Refresh BoolInt `json:"refresh"` Options []Option `json:"options,omitempty"` IncludeAll bool `json:"includeAll"` AllFormat string `json:"allFormat"` AllValue string `json:"allValue"` Multi bool `json:"multi"` MultiFormat string `json:"multiFormat"` Query interface{} `json:"query"` Regex string `json:"regex"` Current Current `json:"current"` Label string `json:"label"` Hide uint8 `json:"hide"` Sort int `json:"sort"` }
type Templating ¶
type Templating struct {
List []TemplateVar `json:"list"`
}
type TextPanel ¶
type TextPanel struct { Content string `json:"content"` Mode string `json:"mode"` PageSize uint `json:"pageSize"` Scroll bool `json:"scroll"` ShowHeader bool `json:"showHeader"` Sort Sort `json:"sort"` Styles []ColumnStyle `json:"styles"` FieldConfig FieldConfig `json:"fieldConfig"` Options struct { Content string `json:"content"` Mode string `json:"mode"` } `json:"options"` }
type Threshold ¶
type Threshold struct { // the alert threshold value, we do not omitempty, since 0 is a valid // threshold Value float32 `json:"value"` // critical, warning, ok, custom ColorMode string `json:"colorMode,omitempty"` // gt or lt Op string `json:"op,omitempty"` Fill bool `json:"fill"` Line bool `json:"line"` // hexadecimal color (e.g. #629e51, only when ColorMode is "custom") FillColor string `json:"fillColor,omitempty"` // hexadecimal color (e.g. #629e51, only when ColorMode is "custom") LineColor string `json:"lineColor,omitempty"` // left or right Yaxis string `json:"yaxis,omitempty"` }
type ThresholdStep ¶
type Thresholds ¶
type Thresholds struct { Mode string `json:"mode"` Steps []ThresholdStep `json:"steps"` }
type Timepicker ¶
type TimeseriesLegendOptions ¶
type TimeseriesOptions ¶
type TimeseriesOptions struct { Legend TimeseriesLegendOptions `json:"legend,omitempty"` Tooltip TimeseriesTooltipOptions `json:"tooltip,omitempty"` }
type TimeseriesPanel ¶
type TimeseriesPanel struct { Targets []Target `json:"targets,omitempty"` Options TimeseriesOptions `json:"options"` FieldConfig FieldConfig `json:"fieldConfig"` }
type TimeseriesTooltipOptions ¶
type TimeseriesTooltipOptions struct {
Mode string `json:"mode"`
}