dashboards

package
v1.82.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DashboardTemplateAnnotation is the key name of the namespace annotation for dashboard templates
	DashboardTemplateAnnotation string = "dashboards.kiali.io/templates"
	// Raw constant for DataType
	Raw = "raw"
	// Rate constant for DataType
	Rate = "rate"
	// Histogram constant for DataType
	Histogram = "histogram"
)
View Source
const DEFAULT_DASHBOARDS_YAML = `` /* 17847-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type MonitoringDashboard

type MonitoringDashboard struct {
	Name          string                            `yaml:"name"`
	Title         string                            `yaml:"title"`
	Runtime       string                            `yaml:"runtime"`
	DiscoverOn    string                            `yaml:"discoverOn"`
	Items         []MonitoringDashboardItem         `yaml:"items"`
	ExternalLinks []MonitoringDashboardExternalLink `yaml:"externalLinks"`
	Rows          int                               `yaml:"rows"`
}

type MonitoringDashboardAggregation

type MonitoringDashboardAggregation struct {
	Label           string `yaml:"label"`
	DisplayName     string `yaml:"displayName"`
	SingleSelection bool   `yaml:"singleSelection"`
}

type MonitoringDashboardChart

type MonitoringDashboardChart struct {
	Name             string                           `yaml:"name"`
	Unit             string                           `yaml:"unit"`      // Stands for the base unit (regardless its scale in datasource)
	UnitScale        float64                          `yaml:"unitScale"` // Stands for the scale of the values in datasource, related to the base unit provided. E.g. unit: "seconds" and unitScale: 0.001 means that values in datasource are actually in milliseconds.
	Spans            int                              `yaml:"spans"`
	StartCollapsed   bool                             `yaml:"startCollapsed"`
	ChartType        *string                          `yaml:"chartType"`
	Min              *int                             `yaml:"min"`
	Max              *int                             `yaml:"max"`
	MetricName       string                           `yaml:"metricName"` // Deprecated; use Metrics instead
	Metrics          []MonitoringDashboardMetric      `yaml:"metrics"`
	DataType         string                           `yaml:"dataType"`   // DataType is either "raw", "rate" or "histogram"
	Aggregator       string                           `yaml:"aggregator"` // Aggregator can be set for raw data. Ex: "sum", "avg". See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators
	Aggregations     []MonitoringDashboardAggregation `yaml:"aggregations"`
	XAxis            *string                          `yaml:"xAxis"`            // "time" (default) or "series"
	GroupLabels      []string                         `yaml:"groupLabels"`      // Prometheus label to be used for grouping; Similar to Aggregations, except this grouping will be always turned on
	SortLabel        string                           `yaml:"sortLabel"`        // Prometheus label to be used for sorting
	SortLabelParseAs string                           `yaml:"sortLabelParseAs"` // Set "int" if the SortLabel needs to be parsed and compared as an integer
}

func (*MonitoringDashboardChart) GetMetrics

GetMetrics provides consistent MonitoringDashboardMetric slice in a backward-compatible way, if deprecated field MetricName is used instead of Metrics in Spec.

type MonitoringDashboardExternalLink struct {
	Type      string                                   `yaml:"type"`
	Name      string                                   `yaml:"name"`
	Variables MonitoringDashboardExternalLinkVariables `yaml:"variables"`
}

type MonitoringDashboardExternalLinkVariables

type MonitoringDashboardExternalLinkVariables struct {
	Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	App       string `json:"app,omitempty" yaml:"app,omitempty"`
	Service   string `json:"service,omitempty" yaml:"service,omitempty"`
	Version   string `json:"version,omitempty" yaml:"version,omitempty"`
	Workload  string `json:"workload,omitempty" yaml:"workload,omitempty"`
}

type MonitoringDashboardItem

type MonitoringDashboardItem struct {
	// Items are exclusive: either Include or Chart must be set (if both are set, Chart will be ignored)
	// Include is a reference to another dashboard and/or chart
	// Ex: "microprofile-1.0" will include the whole dashboard named "microprofile-1.0" at this position
	//		 "microprofile-1.0$Thread count" will include only the chart named "Thread count" from that dashboard at this position
	Include string                   `yaml:"include"`
	Chart   MonitoringDashboardChart `yaml:"chart"`
}

type MonitoringDashboardMetric

type MonitoringDashboardMetric struct {
	MetricName  string `yaml:"metricName"`
	DisplayName string `yaml:"displayName"`
}

type MonitoringDashboardsList

type MonitoringDashboardsList []MonitoringDashboard

func AddMonitoringDashboards

func AddMonitoringDashboards(orig MonitoringDashboardsList, additional MonitoringDashboardsList) MonitoringDashboardsList

AddMonitoringDashboards adds additional dashboards to the original list. If a name of a new dashboard already exists in orig, it replaces the original. Note that the returns list is also stripped of dashboards that should be disabled. A dashboard is disabled if "DiscoverOn" is an empty string and "Items" is an empty list.

func GetBuiltInMonitoringDashboards

func GetBuiltInMonitoringDashboards() MonitoringDashboardsList

func GetNamespaceMonitoringDashboards added in v1.36.2

func GetNamespaceMonitoringDashboards(namespace string, annotations map[string]string) MonitoringDashboardsList

GetNamespaceMonitoringDashboards will examine the given namespace annotations and return any dashboard yaml found.

func GetWorkloadMonitoringDashboards added in v1.36.2

func GetWorkloadMonitoringDashboards(namespace string, workload string, annotations map[string]string) MonitoringDashboardsList

GetWorkloadMonitoringDashboards will examine the given namespace annotations and return any dashboard yaml found.

func (*MonitoringDashboardsList) DeepCopy

func (*MonitoringDashboardsList) OrganizeByName

func (in *MonitoringDashboardsList) OrganizeByName() map[string]MonitoringDashboard

OrganizeByName returns a map with the key being the names of the dashboards; values are the dashboards themselves

Jump to

Keyboard shortcuts

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