Documentation ¶
Index ¶
- func InformMetricsExporterAboutWatchedCHI(chi *WatchedCHI) error
- func InformMetricsExporterToDeleteWatchedCHI(chi *WatchedCHI) error
- type CHIPrometheusWriter
- func (w *CHIPrometheusWriter) WriteDetachedParts(data [][]string)
- func (w *CHIPrometheusWriter) WriteErrorFetch(fetchType string)
- func (w *CHIPrometheusWriter) WriteMetrics(data [][]string)
- func (w *CHIPrometheusWriter) WriteMutations(data [][]string)
- func (w *CHIPrometheusWriter) WriteOKFetch(fetchType string)
- func (w *CHIPrometheusWriter) WriteSystemDisks(data [][]string)
- func (w *CHIPrometheusWriter) WriteSystemParts(data [][]string)
- func (w *CHIPrometheusWriter) WriteSystemReplicas(data [][]string)
- func (w *CHIPrometheusWriter) WriteTableSizes(data [][]string)
- type ClickHouseMetricsFetcher
- type Exporter
- type ScanFunction
- type Table
- type WatchedCHI
- type WatchedCluster
- type WatchedHost
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InformMetricsExporterAboutWatchedCHI ¶
func InformMetricsExporterAboutWatchedCHI(chi *WatchedCHI) error
InformMetricsExporterAboutWatchedCHI informs exporter about new watched CHI
func InformMetricsExporterToDeleteWatchedCHI ¶
func InformMetricsExporterToDeleteWatchedCHI(chi *WatchedCHI) error
InformMetricsExporterToDeleteWatchedCHI informs exporter to delete/forget watched CHI
Types ¶
type CHIPrometheusWriter ¶
type CHIPrometheusWriter struct {
// contains filtered or unexported fields
}
CHIPrometheusWriter specifies writer to prometheus
func NewCHIPrometheusWriter ¶
func NewCHIPrometheusWriter( out chan<- prometheus.Metric, chi *WatchedCHI, host *WatchedHost, ) *CHIPrometheusWriter
NewCHIPrometheusWriter creates new CHI prometheus writer
func (*CHIPrometheusWriter) WriteDetachedParts ¶
func (w *CHIPrometheusWriter) WriteDetachedParts(data [][]string)
WriteDetachedParts writes detached parts
func (*CHIPrometheusWriter) WriteErrorFetch ¶
func (w *CHIPrometheusWriter) WriteErrorFetch(fetchType string)
WriteErrorFetch writes error fetch
func (*CHIPrometheusWriter) WriteMetrics ¶
func (w *CHIPrometheusWriter) WriteMetrics(data [][]string)
WriteMetrics pushes set of prometheus.Metric objects created from the ClickHouse system data Expected data structure: metric, value, description, type (gauge|counter) TODO add namespace handling. It is just skipped for now
func (*CHIPrometheusWriter) WriteMutations ¶
func (w *CHIPrometheusWriter) WriteMutations(data [][]string)
WriteMutations writes mutations
func (*CHIPrometheusWriter) WriteOKFetch ¶
func (w *CHIPrometheusWriter) WriteOKFetch(fetchType string)
WriteOKFetch writes successful fetch
func (*CHIPrometheusWriter) WriteSystemDisks ¶
func (w *CHIPrometheusWriter) WriteSystemDisks(data [][]string)
WriteSystemDisks writes system disks
func (*CHIPrometheusWriter) WriteSystemParts ¶
func (w *CHIPrometheusWriter) WriteSystemParts(data [][]string)
WriteSystemParts pushes set of prometheus.Metric object related to system.parts
func (*CHIPrometheusWriter) WriteSystemReplicas ¶
func (w *CHIPrometheusWriter) WriteSystemReplicas(data [][]string)
WriteSystemReplicas writes system replicas
func (*CHIPrometheusWriter) WriteTableSizes ¶
func (w *CHIPrometheusWriter) WriteTableSizes(data [][]string)
WriteTableSizes pushes set of prometheus.Metric objects created from the ClickHouse system data Expected data structure: database, table, partitions, parts, bytes, uncompressed_bytes, rows TODO add namespace handling. It is just skipped for now
type ClickHouseMetricsFetcher ¶
type ClickHouseMetricsFetcher struct {
// contains filtered or unexported fields
}
ClickHouseMetricsFetcher specifies clickhouse fetcher object
func NewClickHouseFetcher ¶
func NewClickHouseFetcher(endpointConnectionParams *clickhouse.EndpointConnectionParams) *ClickHouseMetricsFetcher
NewClickHouseFetcher creates new clickhouse fetcher object
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter implements prometheus.Collector interface
func NewExporter ¶
NewExporter returns a new instance of Exporter type
func StartMetricsREST ¶
func StartMetricsREST( metricsAddress string, metricsPath string, collectorTimeout time.Duration, chiListAddress string, chiListPath string, ) *Exporter
StartMetricsREST start Prometheus metrics exporter in background
func (*Exporter) Collect ¶
func (e *Exporter) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector Collect method
func (*Exporter) Describe ¶
func (e *Exporter) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector Describe method
func (*Exporter) DiscoveryWatchedCHIs ¶
DiscoveryWatchedCHIs discovers all ClickHouseInstallation objects available for monitoring and adds them to watched list
type ScanFunction ¶
ScanFunction defines function to scan rows
type WatchedCHI ¶
type WatchedCHI struct { Namespace string `json:"namespace"` Name string `json:"name"` Labels map[string]string `json:"labels"` Annotations map[string]string `json:"annotations"` Clusters []*WatchedCluster `json:"clusters"` }
WatchedCHI specifies watched ClickHouseInstallation
func NewWatchedCHI ¶
func NewWatchedCHI(c *api.ClickHouseInstallation) *WatchedCHI
NewWatchedCHI creates new watched CHI
func (*WatchedCHI) GetAnnotations ¶
func (chi *WatchedCHI) GetAnnotations() map[string]string
func (*WatchedCHI) GetLabels ¶
func (chi *WatchedCHI) GetLabels() map[string]string
func (*WatchedCHI) GetName ¶
func (chi *WatchedCHI) GetName() string
func (*WatchedCHI) GetNamespace ¶
func (chi *WatchedCHI) GetNamespace() string
type WatchedCluster ¶
type WatchedCluster struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Hosts []*WatchedHost `json:"hosts,omitempty" yaml:"hosts,omitempty"` }
WatchedCluster specifies watched cluster
type WatchedHost ¶
type WatchedHost struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` TCPPort int32 `json:"tcpPort,omitempty" yaml:"tcpPort,omitempty"` TLSPort int32 `json:"tlsPort,omitempty" yaml:"tlsPort,omitempty"` HTTPPort int32 `json:"httpPort,omitempty" yaml:"httpPort,omitempty"` HTTPSPort int32 `json:"httpsPort,omitempty" yaml:"httpsPort,omitempty"` }
WatchedHost specifies watched host