Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildLabelsMap ¶ added in v0.6.0
BuildLabelsMap initiates a labels map out of a given metric name and optionally histogram stat Exported for external usage (Kiali)
Types ¶
type Aggregation ¶
type Aggregation struct { Label string `json:"label"` DisplayName string `json:"displayName"` SingleSelection bool `json:"singleSelection"` }
Aggregation is the model representing label's allowed aggregation, transformed from aggregation in MonitoringDashboard k8s resource
func ConvertAggregations ¶
func ConvertAggregations(from v1alpha1.MonitoringDashboardSpec) []Aggregation
ConvertAggregations converts a k8s aggregations (from MonitoringDashboard k8s resource) into this models aggregations Results are sorted by DisplayName
type Chart ¶
type Chart struct { Name string `json:"name"` Unit string `json:"unit"` Spans int `json:"spans"` StartCollapsed bool `json:"startCollapsed"` ChartType *string `json:"chartType,omitempty"` Min *int `json:"min,omitempty"` Max *int `json:"max,omitempty"` Metrics []*SampleStream `json:"metrics"` XAxis *string `json:"xAxis"` Error string `json:"error"` }
Chart is the model representing a custom chart, transformed from charts in MonitoringDashboard k8s resource
func ConvertChart ¶
func ConvertChart(from v1alpha1.MonitoringDashboardChart) Chart
ConvertChart converts a k8s chart (from MonitoringDashboard k8s resource) into this models chart
func (*Chart) FillHistogram ¶ added in v0.6.0
func (chart *Chart) FillHistogram(ref v1alpha1.MonitoringDashboardMetric, from prometheus.Histogram, conversionParams ConversionParams)
func (*Chart) FillMetric ¶ added in v0.6.0
func (chart *Chart) FillMetric(ref v1alpha1.MonitoringDashboardMetric, from prometheus.Metric, conversionParams ConversionParams)
type ConversionParams ¶ added in v0.6.1
type DashboardQuery ¶
type DashboardQuery struct { prometheus.MetricsQuery Namespace string LabelsFilters map[string]string AdditionalLabels []Aggregation RawDataAggregator string }
DashboardQuery holds query parameters for a dashboard query
func (*DashboardQuery) FillDefaults ¶
func (q *DashboardQuery) FillDefaults()
FillDefaults fills the struct with default parameters
type DashboardRef ¶
DashboardRef holds template name and title for a custom dashboard
type ExternalLink ¶ added in v0.3.0
type ExternalLink struct { URL string `json:"url"` Name string `json:"name"` Variables v1alpha1.MonitoringDashboardExternalLinkVariables `json:"variables"` }
ExternalLink provides links to external dashboards (e.g. to Grafana)
type MonitoringDashboard ¶
type MonitoringDashboard struct { Title string `json:"title"` Charts []Chart `json:"charts"` Aggregations []Aggregation `json:"aggregations"` ExternalLinks []ExternalLink `json:"externalLinks"` }
MonitoringDashboard is the model representing custom monitoring dashboard, transformed from MonitoringDashboard k8s resource
type Runtime ¶
type Runtime struct { Name string `json:"name"` DashboardRefs []DashboardRef `json:"dashboardRefs"` }
Runtime holds the runtime title and associated dashboard template(s)
type SamplePair ¶
func (SamplePair) MarshalJSON ¶
func (s SamplePair) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type SampleStream ¶
type SampleStream struct { LabelSet map[string]string `json:"labelSet"` Values []SamplePair `json:"values"` }
func ConvertMatrix ¶
func ConvertMatrix(from pmod.Matrix, initialLabels map[string]string, conversionParams ConversionParams) []*SampleStream