Documentation
¶
Index ¶
- Variables
- func NewAuditdCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector
- func NewBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector
- func NewFilebeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector
- func NewLibBeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector
- func NewMainCollector(client *http.Client, url *url.URL, name string, beatInfo *BeatInfo, ...) prometheus.Collector
- func NewMetricbeatCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector
- func NewRegistrarCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector
- func NewSystemCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector
- type AuditdStats
- type BeatInfo
- type BeatStats
- type CPUStats
- type CPUTimings
- type Filebeat
- type LibBeat
- type LibBeatEvents
- type LibBeatOutput
- type LibBeatOutputBytesErrors
- type LibBeatPipeline
- type Metricbeat
- type MetricbeatEvent
- type Registrar
- type Stats
- type System
Constants ¶
This section is empty.
Variables ¶
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 NewAuditdCollector ¶
func NewAuditdCollector(beatInfo *BeatInfo, stats *Stats) prometheus.Collector
NewAuditdCollector constructor
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, systemBeat bool) 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 AuditdStats ¶
type AuditdStats struct {
KernelLost float64 `json:"kernel_lost"`
ReassemblerSeqGaps float64 `json:"reassembler_seq_gaps"`
ReceivedMsgs float64 `json:"received_msgs"`
UserspaceLost float64 `json:"userspace_lost"`
}
AuditdInfo json structure
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 {
System 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"`
Runtime struct {
Goroutines uint64 `json:"goroutines"`
} `json:"runtime"`
}
BeatStats 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 ¶
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"`
Auditd AuditdStats `json:"auditd"`
}
Stats stats endpoint json structure