app

package
v0.0.0-...-c2f5433 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgent

func NewAgent(ctx context.Context, criEndpoint string) (*criAgent, error)

NewAgent creates a new agent. It returns an error if the connection to the CRI endpoint fails.

func NewApp

func NewApp(ctx context.Context, criEndpoint, metricsNamePrefix, bindAddr string) (*app, error)

NewApp creates a new app instance.

Types

type Agent

type Agent interface {
	GetRuntimeVersion(ctx context.Context) (*cri.VersionResponse, error)
	ListContainers(ctx context.Context) (*cri.ListContainersResponse, error)
	GetStatus(ctx context.Context) (*cri.StatusResponse, error)
	GetRuntimeConfig(ctx context.Context) (*cri.RuntimeConfigResponse, error)
	ListPods(ctx context.Context) (*cri.ListPodSandboxResponse, error)
	ListImages(ctx context.Context) (*cri.ListImagesResponse, error)
	FsInfo(ctx context.Context) (*cri.ImageFsInfoResponse, error)
}

Agent defines the interface for an Agent.

type Metrics

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

Metrics represents the metrics of the CRI agent. It implements prometheus.Collector.

func NewMetrics

func NewMetrics(agent Agent, prefix string) *Metrics

NewMetrics creates a new metrics collector.

func (*Metrics) Collect

func (m *Metrics) Collect(ch chan<- prometheus.Metric)

Collect is called by the Prometheus registry when collecting metrics.

func (*Metrics) Describe

func (m *Metrics) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics.

Jump to

Keyboard shortcuts

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