Documentation
¶
Overview ¶
Package dashboards defines the portable custom dashboard document, its JSON Schema and the starter templates.
Index ¶
Constants ¶
View Source
const ( ScopeUser = "user" TargetApp = "app" TargetDatabase = "database" TargetNode = "node" WidgetMetricChart = "metric_chart" WidgetRequestPcts = "request_percentiles" WidgetErrorRate = "error_rate" WidgetLogTail = "log_tail" WidgetDeployTimeline = "deploy_timeline" WidgetResourceCounts = "resource_counts" WidgetCost = "cost" WidgetAlertStatus = "alert_status" WidgetNodeCapacity = "node_capacity" WidgetLink = "link" )
Dashboard scopes, target kinds and widget types, matching schema.json.
View Source
const Version = 1
Version is the document format version; export files carry it so imports can reject newer formats.
Variables ¶
View Source
var ErrInvalid = errors.New("invalid dashboard")
ErrInvalid wraps every validation failure so callers can answer 400.
Functions ¶
This section is empty.
Types ¶
type Doc ¶
type Doc struct {
Version int `json:"version"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
TimeRange string `json:"time_range,omitempty"`
RefreshSeconds int `json:"refresh_seconds,omitempty"`
Widgets []Widget `json:"widgets"`
}
Doc is the exportable body of a dashboard.
type Template ¶
type Template struct {
Key string `json:"key"`
Doc Doc `json:"doc"`
NeedsTarget string `json:"needs_target,omitempty"`
}
Template is a one-click starter dashboard; the picker fills the empty target names of NeedsTarget kind.
type Widget ¶
type Widget struct {
ID string `json:"id"`
Type string `json:"type"`
Title string `json:"title,omitempty"`
Size string `json:"size"`
Target *Target `json:"target,omitempty"`
Metric string `json:"metric,omitempty"`
Query string `json:"query,omitempty"`
URL string `json:"url,omitempty"`
}
Widget is one tile on the dashboard grid.
Click to show internal directories.
Click to hide internal directories.