collector

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HackfixRegex = regexp.MustCompile("\"time\":(\\d+)") // replaces time:123 to time.ms:123, only filebeat has different naming of time metric

HackfixRegex regex to replace JSON part

Functions

func NewBeatCollector

func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector

NewBeatCollector constructor

func NewFilebeatCollector

func NewFilebeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector

NewFilebeatCollector constructor

func NewLibBeatCollector

func NewLibBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector

NewLibBeatCollector constructor

func NewMainCollector

func NewMainCollector(client *http.Client, url *url.URL, name string, beatInfo *BeatInfo) prometheus.Collector

NewMainCollector constructor

func NewMetricbeatCollector

func NewMetricbeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector

NewMetricbeatCollector constructor

func NewRegistrarCollector

func NewRegistrarCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector

NewRegistrarCollector constructor

func NewSystemCollector

func NewSystemCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector

NewSystemCollector constructor

Types

type BeatInfo

type BeatInfo struct {
	Beat     string `json:"beat"`
	Hostname string `json:"hostname"`
	Name     string `json:"name"`
	UUID     string `json:"uuid"`
	Version  string `json:"version"`
}

BeatInfo beat info json structure

type BeatStats

type BeatStats struct {
	CPU struct {
		Sytem CPUTimings `json:"system"`
		Total CPUTimings `json:"total"`
		User  CPUTimings `json:"user"`
	} `json:"cpu"`
	BeatUptime struct {
		Uptime struct {
			MS float64 `json:"ms"`
		} `json:"uptime"`

		EmphemeralID string `json:"emphemeral_id"`
	} `json:"info"`

	Memstats struct {
		GCNext      float64 `json:"gc_next"`
		MemoryAlloc float64 `json:"memory_alloc"`
		MemoryTotal float64 `json:"memory_total"`
		RSS         float64 `json:"rss"`
	} `json:"memstats"`
}

BeatStats json structure

type CPUStats

type CPUStats struct {
	M1  float64 `json:"1"`
	M5  float64 `json:"5"`
	M15 float64 `json:"15"`
}

CPUStats json structure

type CPUTimings

type CPUTimings struct {
	Ticks float64 `json:"ticks"`
	Time  struct {
		MS float64 `json:"ms"`
	} `json:"time"`
	Value float64 `json:"value"`
}

CPUTimings json structure

type Filebeat

type Filebeat struct {
	Events struct {
		Active float64 `json:"active"`
		Added  float64 `json:"added"`
		Done   float64 `json:"done"`
	} `json:"events"`

	Harvester struct {
		Closed    float64 `json:"closed"`
		OpenFiles float64 `json:"open_files"`
		Running   float64 `json:"running"`
		Skipped   float64 `json:"skipped"`
		Started   float64 `json:"started"`
	} `json:"harvester"`

	Input struct {
		Log struct {
			Files struct {
				Renamed   float64 `json:"renamed"`
				Truncated float64 `json:"truncated"`
			} `json:"files"`
		} `json:"log"`
	} `json:"input"`
}

Filebeat json structure

type LibBeat

type LibBeat struct {
	Config struct {
		Module struct {
			Running float64 `json:"running"`
			Starts  float64 `json:"starts"`
			Stops   float64 `json:"stops"`
		} `json:"module"`
		Reloads float64 `json:"reloads"`
	} `json:"config"`
	Output   LibBeatOutput   `json:"output"`
	Pipeline LibBeatPipeline `json:"pipeline"`
}

LibBeat json structure

type LibBeatEvents

type LibBeatEvents struct {
	Acked      float64 `json:"acked"`
	Active     float64 `json:"active"`
	Batches    float64 `json:"batches"`
	Dropped    float64 `json:"dropped"`
	Duplicates float64 `json:"duplicates"`
	Failed     float64 `json:"failed"`
	Filtered   float64 `json:"filtered"`
	Published  float64 `json:"published"`
	Retry      float64 `json:"retry"`
}

LibBeatEvents json structure

type LibBeatOutput

type LibBeatOutput struct {
	Events LibBeatEvents            `json:"events"`
	Read   LibBeatOutputBytesErrors `json:"read"`
	Write  LibBeatOutputBytesErrors `json:"write"`
	Type   string                   `json:"type"`
}

LibBeatOutput json structure

type LibBeatOutputBytesErrors

type LibBeatOutputBytesErrors struct {
	Bytes  float64 `json:"bytes"`
	Errors float64 `json:"errors"`
}

LibBeatOutputBytesErrors json structure

type LibBeatPipeline

type LibBeatPipeline struct {
	Clients float64       `json:"clients"`
	Events  LibBeatEvents `json:"events"`
	Queue   struct {
		Acked float64 `json:"acked"`
	} `json:"queue"`
}

LibBeatPipeline json structure

type Metricbeat

type Metricbeat struct {
	System struct {
		CPU            MetricbeatEvent `json:"cpu"`
		Filesystem     MetricbeatEvent `json:"filesystem"`
		Fsstat         MetricbeatEvent `json:"fsstat"`
		Load           MetricbeatEvent `json:"load"`
		Memory         MetricbeatEvent `json:"memory"`
		Network        MetricbeatEvent `json:"network"`
		Process        MetricbeatEvent `json:"process"`
		ProcessSummary MetricbeatEvent `json:"process_summary"`
		Uptime         MetricbeatEvent `json:"uptime"`
	} `json:"system"`
}

Metricbeat json structure

type MetricbeatEvent

type MetricbeatEvent struct {
	Failures float64 `json:"failures"`
	Success  float64 `json:"success"`
}

MetricbeatEvent json structure

type Registrar

type Registrar struct {
	Writes struct {
		Fail    float64 `json:"fail"`
		Success float64 `json:"success"`
		Total   float64 `json:"total"`
	} `json:"writes"`
	States struct {
		Cleanup float64 `json:"cleanup"`
		Current float64 `json:"current"`
		Update  float64 `json:"update"`
	} `json:"states"`
}

Registrar json structure

type Stats

type Stats struct {
	System     System     `json:"system"`
	Beat       BeatStats  `json:"beat"`
	LibBeat    LibBeat    `json:"libbeat"`
	Registrar  Registrar  `json:"registrar"`
	Filebeat   Filebeat   `json:"filebeat"`
	Metricbeat Metricbeat `json:"metricbeat"`
}

Stats stats endpoint json structure

type System

type System struct {
	CPU struct {
		Cores int64 `json:"cores"`
	} `json:"cpu"`
	Load struct {
		CPUStats
		Norm CPUStats `json:"norm"`
	} `json:"load"`
}

System json structure

Jump to

Keyboard shortcuts

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