Documentation ¶
Index ¶
- func FillHistogram(from prometheus.Histogram, scale float64, name string, chart *Chart)
- func FillMetric(from prometheus.Metric, scale float64, name string, chart *Chart)
- type Aggregation
- type Chart
- type DashboardQuery
- type DashboardRef
- type ExternalLink
- type MonitoringDashboard
- type Pod
- type Runtime
- type SamplePair
- type SampleStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FillHistogram ¶ added in v0.3.0
func FillHistogram(from prometheus.Histogram, scale float64, name string, chart *Chart)
func FillMetric ¶ added in v0.3.0
func FillMetric(from prometheus.Metric, scale float64, name string, chart *Chart)
Types ¶
type Aggregation ¶
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"` ChartType *string `json:"chartType,omitempty"` Min *int `json:"min,omitempty"` Max *int `json:"max,omitempty"` Metric []*SampleStream `json:"metric"` Histogram map[string][]*SampleStream `json:"histogram"` 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
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, scale float64) []*SampleStream