observabilitydashboards

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = 1

Variables

This section is empty.

Functions

func Render

func Render(bundle Bundle) ([]byte, error)

Types

type Bundle

type Bundle struct {
	SchemaVersion int         `json:"schema_version" yaml:"schema_version"`
	Backend       string      `json:"backend" yaml:"backend"`
	Organization  string      `json:"organization" yaml:"organization"`
	Dashboards    []Dashboard `json:"dashboards" yaml:"dashboards"`
}

func Load

func Load(path string) (Bundle, error)

func (Bundle) Validate

func (b Bundle) Validate() error

type Dashboard

type Dashboard struct {
	ID             string  `json:"id" yaml:"id"`
	Title          string  `json:"title" yaml:"title"`
	RefreshSeconds int     `json:"refresh_seconds" yaml:"refresh_seconds"`
	DefaultRange   string  `json:"default_range" yaml:"default_range"`
	Owner          string  `json:"owner" yaml:"owner"`
	Runbook        string  `json:"runbook" yaml:"runbook"`
	Panels         []Panel `json:"panels" yaml:"panels"`
}

func (Dashboard) Validate

func (d Dashboard) Validate() error

type DateTimeOptions

type DateTimeOptions struct {
	Type               string `json:"type"`
	RelativeTimePeriod string `json:"relativeTimePeriod"`
}

type OpenObserveClient

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

func NewOpenObserveClient

func NewOpenObserveClient(endpoint, username, password string) (*OpenObserveClient, error)

func (*OpenObserveClient) Apply

func (c *OpenObserveClient) Apply(ctx context.Context, organization, folder string, desired []OpenObserveDashboard) (ReconcilePlan, error)

func (*OpenObserveClient) Plan

func (c *OpenObserveClient) Plan(ctx context.Context, organization, folder string, desired []OpenObserveDashboard) (ReconcilePlan, error)

type OpenObserveDashboard

type OpenObserveDashboard struct {
	Version                 int              `json:"version"`
	DashboardID             string           `json:"dashboardId,omitempty"`
	Title                   string           `json:"title"`
	Description             string           `json:"description"`
	Role                    string           `json:"role"`
	Owner                   string           `json:"owner,omitempty"`
	Tabs                    []OpenObserveTab `json:"tabs"`
	Variables               Variables        `json:"variables"`
	DefaultDatetimeDuration DateTimeOptions  `json:"defaultDatetimeDuration"`
}

func RenderOpenObserve

func RenderOpenObserve(bundle Bundle) ([]OpenObserveDashboard, error)

type OpenObservePanel

type OpenObservePanel struct {
	ID          string             `json:"id"`
	Type        string             `json:"type"`
	Title       string             `json:"title"`
	Description string             `json:"description"`
	Config      PanelConfig        `json:"config"`
	QueryType   string             `json:"queryType"`
	Queries     []OpenObserveQuery `json:"queries"`
	Layout      PanelLayout        `json:"layout"`
}

type OpenObserveQuery

type OpenObserveQuery struct {
	Query            string      `json:"query"`
	VRLFunctionQuery string      `json:"vrlFunctionQuery"`
	CustomQuery      bool        `json:"customQuery"`
	Fields           PanelFields `json:"fields"`
	Config           QueryConfig `json:"config"`
}

type OpenObserveTab

type OpenObserveTab struct {
	TabID  string             `json:"tabId"`
	Name   string             `json:"name"`
	Panels []OpenObservePanel `json:"panels"`
}

type Panel

type Panel struct {
	ID          string `json:"id" yaml:"id"`
	Title       string `json:"title" yaml:"title"`
	Kind        string `json:"kind" yaml:"kind"`
	Query       string `json:"query" yaml:"query"`
	Unit        string `json:"unit" yaml:"unit"`
	Description string `json:"description" yaml:"description"`
}

func (Panel) Validate

func (p Panel) Validate() error

type PanelConfig

type PanelConfig struct {
	ShowLegends     bool   `json:"show_legends"`
	LegendsPosition string `json:"legends_position,omitempty"`
	Unit            string `json:"unit,omitempty"`
}

type PanelFields

type PanelFields struct {
	Stream     string      `json:"stream"`
	StreamType string      `json:"stream_type"`
	X          []any       `json:"x"`
	Y          []any       `json:"y"`
	Z          []any       `json:"z"`
	Breakdown  []any       `json:"breakdown"`
	Filter     PanelFilter `json:"filter"`
}

type PanelFilter

type PanelFilter struct {
	FilterType      string `json:"filterType"`
	LogicalOperator string `json:"logicalOperator"`
	Conditions      []any  `json:"conditions"`
}

type PanelLayout

type PanelLayout struct {
	X int `json:"x"`
	Y int `json:"y"`
	W int `json:"w"`
	H int `json:"h"`
	I int `json:"i"`
}

type QueryConfig

type QueryConfig struct {
	PromQLLegend string `json:"promql_legend"`
	LayerType    string `json:"layer_type"`
}

type ReconcileAction

type ReconcileAction struct {
	Kind        string                `json:"kind"`
	Title       string                `json:"title"`
	DashboardID string                `json:"dashboard_id,omitempty"`
	Hash        string                `json:"hash,omitempty"`
	Desired     *OpenObserveDashboard `json:"desired,omitempty"`
}

type ReconcilePlan

type ReconcilePlan struct {
	SchemaVersion int               `json:"schema_version"`
	State         string            `json:"state"`
	Organization  string            `json:"organization"`
	Folder        string            `json:"folder"`
	Actions       []ReconcileAction `json:"actions"`
}

type Variables

type Variables struct {
	List               []any `json:"list"`
	ShowDynamicFilters bool  `json:"showDynamicFilters"`
}

Jump to

Keyboard shortcuts

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