dashboards

package
v0.4.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package dashboards stores the operator's own views over FlatRun's telemetry: which series they care about, arranged how they want them. The panels name what to draw; the data behind each one is fetched from whichever part of the agent owns it.

Index

Constants

View Source
const (
	SourceContainer = "container"
	SourceServing   = "serving"
)

Panel sources. Container metrics come from the observability engine; serving metrics come from the proxy's record of real requests.

View Source
const (
	ServingRequests = "requests"
	ServingErrors   = "errors"
	ServingLatency  = "latency"
)

Serving series a panel can draw, named for what an operator is asking rather than for the column behind it.

View Source
const (
	PanelLine = "line"
	PanelStat = "stat"
)

Panel shapes.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dashboard

type Dashboard struct {
	ID     string  `json:"id" yaml:"id"`
	Name   string  `json:"name" yaml:"name"`
	Panels []Panel `json:"panels" yaml:"panels"`
}

Dashboard is a named set of panels.

func (Dashboard) Validate

func (d Dashboard) Validate() error

Validate reports why a dashboard cannot be saved, if it cannot.

type Panel

type Panel struct {
	ID     string `json:"id" yaml:"id"`
	Title  string `json:"title" yaml:"title"`
	Source string `json:"source" yaml:"source"`
	// Series is a container metric name for the container source, or one of the serving
	// series for the serving source.
	Series string `json:"series" yaml:"series"`
	// Deployment scopes the panel. Empty means every deployment.
	Deployment string `json:"deployment,omitempty" yaml:"deployment,omitempty"`
	Type       string `json:"type" yaml:"type"`
	// Width is how many of the grid's twelve columns the panel takes.
	Width int `json:"width" yaml:"width"`
}

Panel is one chart: a series, scoped to a deployment or to the whole host.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store keeps dashboards in a flat file beside the rest of FlatRun's state, so they can be read, edited and copied between hosts without the UI.

func NewStore

func NewStore(basePath string) *Store

func (*Store) Delete

func (s *Store) Delete(id string) (bool, error)

Delete removes a dashboard, reporting whether it was there.

func (*Store) Get

func (s *Store) Get(id string) (Dashboard, bool)

Get returns one dashboard by id.

func (*Store) List

func (s *Store) List() []Dashboard

List returns every dashboard, and none when the file has never been written.

func (*Store) Save

func (s *Store) Save(d Dashboard) (Dashboard, error)

Save creates or replaces a dashboard, giving it and any new panel an id, and returns what was stored.

Jump to

Keyboard shortcuts

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