metrics

package
v0.0.0-...-b2588bf Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteWatchREST

func DeleteWatchREST(namespace, chiName string) error

func MakeRESTCall

func MakeRESTCall(chi *WatchedChi, op string) error

func UpdateWatchREST

func UpdateWatchREST(namespace, chiName string, hostnames []string) error

Types

type ClickHouseFetcher

type ClickHouseFetcher struct {
	Hostname string
	Username string
	Password string
	Port     int
}

func NewClickHouseFetcher

func NewClickHouseFetcher(hostname, username, password string, port int) *ClickHouseFetcher

type Exporter

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

Exporter implements prometheus.Collector interface

func NewExporter

func NewExporter(username, password string, port int) *Exporter

NewExporter returns a new instance of Exporter type

func StartMetricsREST

func StartMetricsREST(
	username, password string, port int,
	metricsAddress, metricsPath string,
	chiListAddress, 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) ServeHTTP

func (e *Exporter) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Exporter) UpdateWatch

func (e *Exporter) UpdateWatch(namespace, chiName string, hostnames []string)

Ensure hostnames of the Pods from CHI object included into chopmetrics.Exporter state

func (*Exporter) WalkWatchedChi

func (e *Exporter) WalkWatchedChi(f func(chi *WatchedChi, hostname string))

type PrometheusWriter

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

func NewPrometheusWriter

func NewPrometheusWriter(
	out chan<- prometheus.Metric,
	chi *WatchedChi,
	hostname string,
) *PrometheusWriter

func (*PrometheusWriter) WriteErrorFetch

func (w *PrometheusWriter) WriteErrorFetch(fetch_type string)

func (*PrometheusWriter) WriteMetrics

func (w *PrometheusWriter) 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 (*PrometheusWriter) WriteMutations

func (w *PrometheusWriter) WriteMutations(data [][]string)

func (*PrometheusWriter) WriteOKFetch

func (w *PrometheusWriter) WriteOKFetch(fetch_type string)

func (*PrometheusWriter) WriteSystemReplicas

func (w *PrometheusWriter) WriteSystemReplicas(data [][]string)

func (*PrometheusWriter) WriteTableSizes

func (w *PrometheusWriter) 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 WatchedChi

type WatchedChi struct {
	Namespace string   `json:"namespace"`
	Name      string   `json:"name"`
	Hostnames []string `json:"hostnames"`
}

Jump to

Keyboard shortcuts

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