collector

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DropPointSubscriber = "subscriber"
	DropPointConsole    = "console"
	DropPointForward    = "forward"
)

Variables

View Source
var (
	LogLinesDropped = promauto.With(prometheus.DefaultRegisterer).NewCounterVec(prometheus.CounterOpts{
		Name: "log_lines_dropped_total",
		Help: "workload log lines that never reached their destination, by the point that lost them.",
	}, []string{labelPoint})
)

Functions

func Probe

func Probe(ctx context.Context, w *source.Workload, timeout time.Duration) bool

Probe reports whether the workload answers the health check core declared for it.

Types

type Collector

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

Collector samples the cgroup and netns counters of the workloads a source yields.

func New

func New(ctx context.Context, config *types.Config) *Collector

func (*Collector) Collect

func (c *Collector) Collect(ctx context.Context, w *source.Workload, refresh refreshFunc)

Collect samples one workload every metrics step until ctx is canceled; a step that fails is retried on the next one.

type Console

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

Console follows a vm's serial console: every line is forwarded live and journaled for history.

func NewConsole

func NewConsole(workloadID, appname string, path pathFunc) *Console

func (*Console) Read

func (c *Console) Read(ctx context.Context, handle EntryHandler)

Read follows the console until ctx is done, reconnecting so a vm that restarts comes back on its own.

type Entry

type Entry struct {
	WorkloadID string
	Unit       string
	Stream     string
	Data       string
	Time       time.Time
}

Entry is one journal record, addressed by the workload id the log shim wrote or by its unit.

type EntryHandler

type EntryHandler func(*Entry)

type Journal

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

Journal follows the node's journal and hands every eru workload line to one reader.

func NewJournal

func NewJournal(stateDir string) *Journal

func (*Journal) Read

func (j *Journal) Read(ctx context.Context, handle EntryHandler) error

Read follows the journal until ctx is done, calling handle for every eru workload line.

type MetricsClient

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

func NewMetricsClient

func NewMetricsClient(statsd, hostname string, w *source.Workload, unsupported []string) *MetricsClient

func (*MetricsClient) BytesRecv

func (m *MetricsClient) BytesRecv(nic string, i float64)

func (*MetricsClient) BytesSent

func (m *MetricsClient) BytesSent(nic string, i float64)

func (*MetricsClient) CPUContainerSysUsage

func (m *MetricsClient) CPUContainerSysUsage(i float64)

func (*MetricsClient) CPUContainerUsage

func (m *MetricsClient) CPUContainerUsage(i float64)

func (*MetricsClient) CPUContainerUserUsage

func (m *MetricsClient) CPUContainerUserUsage(i float64)

func (*MetricsClient) CPUHostSysUsage

func (m *MetricsClient) CPUHostSysUsage(i float64)

func (*MetricsClient) CPUHostUsage

func (m *MetricsClient) CPUHostUsage(i float64)

func (*MetricsClient) CPUHostUserUsage

func (m *MetricsClient) CPUHostUserUsage(i float64)

func (*MetricsClient) DropIn

func (m *MetricsClient) DropIn(nic string, i float64)

func (*MetricsClient) DropOut

func (m *MetricsClient) DropOut(nic string, i float64)

func (*MetricsClient) ErrIn

func (m *MetricsClient) ErrIn(nic string, i float64)

func (*MetricsClient) ErrOut

func (m *MetricsClient) ErrOut(nic string, i float64)

func (*MetricsClient) IOServiceBytesRead

func (m *MetricsClient) IOServiceBytesRead(dev string, i float64)

func (*MetricsClient) IOServiceBytesReadPerSecond

func (m *MetricsClient) IOServiceBytesReadPerSecond(dev string, i float64)

func (*MetricsClient) IOServiceBytesWrite

func (m *MetricsClient) IOServiceBytesWrite(dev string, i float64)

func (*MetricsClient) IOServiceBytesWritePerSecond

func (m *MetricsClient) IOServiceBytesWritePerSecond(dev string, i float64)

func (*MetricsClient) IOServicedRead

func (m *MetricsClient) IOServicedRead(dev string, i float64)

func (*MetricsClient) IOServicedReadPerSecond

func (m *MetricsClient) IOServicedReadPerSecond(dev string, i float64)

func (*MetricsClient) IOServicedWrite

func (m *MetricsClient) IOServicedWrite(dev string, i float64)

func (*MetricsClient) IOServicedWritePerSecond

func (m *MetricsClient) IOServicedWritePerSecond(dev string, i float64)

func (*MetricsClient) MemMaxUsage

func (m *MetricsClient) MemMaxUsage(i float64)

func (*MetricsClient) MemPercent

func (m *MetricsClient) MemPercent(i float64)

func (*MetricsClient) MemRSSPercent

func (m *MetricsClient) MemRSSPercent(i float64)

func (*MetricsClient) MemRss

func (m *MetricsClient) MemRss(i float64)

func (*MetricsClient) MemUsage

func (m *MetricsClient) MemUsage(i float64)

func (*MetricsClient) PacketsRecv

func (m *MetricsClient) PacketsRecv(nic string, i float64)

func (*MetricsClient) PacketsSent

func (m *MetricsClient) PacketsSent(nic string, i float64)

func (*MetricsClient) Send

func (m *MetricsClient) Send(ctx context.Context) error

func (*MetricsClient) Unregister

func (m *MetricsClient) Unregister()

Jump to

Keyboard shortcuts

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