collector

package
v0.0.0-...-c31191e Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDruidData

func GetDruidData(pathURL string) []map[string]interface{}

GetDruidData return all the tasks and its state

func GetDruidHealthMetrics

func GetDruidHealthMetrics() float64

GetDruidHealthMetrics returns the set of metrics for druid

Types

type DataSourcesTotalRows

type DataSourcesTotalRows []struct {
	Datasource string `json:"datasource"`
	Source     string `json:"source"`
	TotalRows  int64  `json:"total_rows"`
}

DataSourcesTotalRows shows total rows from each datasource

func GetDruidDataSourcesTotalRows

func GetDruidDataSourcesTotalRows(pathURL string) DataSourcesTotalRows

GetDruidDataSourcesTotalRows returns the amount of rows in each datasource

type MetricCollector

type MetricCollector struct {
	DruidHealthStatus         *prometheus.Desc
	DataSourceCount           *prometheus.Desc
	DruidWorkers              *prometheus.Desc
	DruidTasks                *prometheus.Desc
	DruidSupervisors          *prometheus.Desc
	DruidSegmentCount         *prometheus.Desc
	DruidSegmentSize          *prometheus.Desc
	DruidSegmentReplicateSize *prometheus.Desc
	DruidDataSourcesTotalRows *prometheus.Desc
	DruidRunningTasks         *prometheus.Desc
	DruidWaitingTasks         *prometheus.Desc
	DruidCompletedTasks       *prometheus.Desc
	DruidPendingTasks         *prometheus.Desc
	DruidTaskCapacity         *prometheus.Desc
}

MetricCollector includes the list of metrics

func Collector

func Collector() *MetricCollector

Collector return the defined metrics

func (*MetricCollector) Collect

func (collector *MetricCollector) Collect(ch chan<- prometheus.Metric)

Collect will collect all the metrics

func (*MetricCollector) Describe

func (collector *MetricCollector) Describe(ch chan<- *prometheus.Desc)

Describe will associate the value for druid exporter

type SegementInterface

type SegementInterface []struct {
	Name       string `json:"name"`
	Properties struct {
		Tiers struct {
			DefaultTier struct {
				Size           int64 `json:"size"`
				ReplicatedSize int64 `json:"replicatedSize"`
				SegmentCount   int   `json:"segmentCount"`
			} `json:"_default_tier"`
		} `json:"tiers"`
		Segments struct {
			MaxTime        time.Time `json:"maxTime"`
			Size           int64     `json:"size"`
			MinTime        time.Time `json:"minTime"`
			Count          int       `json:"count"`
			ReplicatedSize int64     `json:"replicatedSize"`
		} `json:"segments"`
	} `json:"properties"`
}

SegementInterface is the interface for parsing segments data

func GetDruidSegmentData

func GetDruidSegmentData() SegementInterface

GetDruidSegmentData returns the datasources of druid

type TaskStatusMetric

type TaskStatusMetric []struct {
	NameDataSource string `json:"dataSource"`
	StatusCode     string `json:"statusCode"`
}

TaskStatusMetric is the interface for tasks status

func GetDruidTasksStatusCount

func GetDruidTasksStatusCount(pathURL string) TaskStatusMetric

GetDruidTasksStatusCount returns count of different tasks by status

type TasksInterface

type TasksInterface []struct {
	ID               string  `json:"id"`
	GroupID          string  `json:"groupId"`
	Type             string  `json:"type"`
	CreatedTime      string  `json:"createdTime"`
	StatusCode       string  `json:"statusCode"`
	Status           string  `json:"status"`
	RunnerStatusCode string  `json:"runnerStatusCode"`
	Duration         float64 `json:"duration"`
	DataSource       string  `json:"dataSource"`
}

TasksInterface is the interface for parsing druid tasks data

func GetDruidTasksData

func GetDruidTasksData(pathURL string) TasksInterface

GetDruidTasksData return all the tasks and its state

Jump to

Keyboard shortcuts

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