containers

package
v1.18.10 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	L7Requests = map[l7.Protocol]prometheus.CounterOpts{
		l7.ProtocolHTTP:      {Name: "container_http_requests_total", Help: "Total number of outbound HTTP requests"},
		l7.ProtocolPostgres:  {Name: "container_postgres_queries_total", Help: "Total number of outbound Postgres queries"},
		l7.ProtocolRedis:     {Name: "container_redis_queries_total", Help: "Total number of outbound Redis queries"},
		l7.ProtocolMemcached: {Name: "container_memcached_queries_total", Help: "Total number of outbound Memcached queries"},
		l7.ProtocolMysql:     {Name: "container_mysql_queries_total", Help: "Total number of outbound Mysql queries"},
		l7.ProtocolMongo:     {Name: "container_mongo_queries_total", Help: "Total number of outbound Mongo queries"},
		l7.ProtocolKafka:     {Name: "container_kafka_requests_total", Help: "Total number of outbound Kafka requests"},
		l7.ProtocolCassandra: {Name: "container_cassandra_queries_total", Help: "Total number of outbound Cassandra requests"},
		l7.ProtocolRabbitmq:  {Name: "container_rabbitmq_messages_total", Help: "Total number of Rabbitmq messages produced or consumed by the container"},
		l7.ProtocolNats:      {Name: "container_nats_messages_total", Help: "Total number of NATS messages produced or consumed by the container"},
		l7.ProtocolDubbo2:    {Name: "container_dubbo_requests_total", Help: "Total number of outbound DUBBO requests"},
	}
	L7Latency = map[l7.Protocol]prometheus.HistogramOpts{
		l7.ProtocolHTTP:      {Name: "container_http_requests_duration_seconds_total", Help: "Histogram of the response time for each outbound HTTP request"},
		l7.ProtocolPostgres:  {Name: "container_postgres_queries_duration_seconds_total", Help: "Histogram of the execution time for each outbound Postgres query"},
		l7.ProtocolRedis:     {Name: "container_redis_queries_duration_seconds_total", Help: "Histogram of the execution time for each outbound Redis query"},
		l7.ProtocolMemcached: {Name: "container_memcached_queries_duration_seconds_total", Help: "Histogram of the execution time for each outbound Memcached query"},
		l7.ProtocolMysql:     {Name: "container_mysql_queries_duration_seconds_total", Help: "Histogram of the execution time for each outbound Mysql query"},
		l7.ProtocolMongo:     {Name: "container_mongo_queries_duration_seconds_total", Help: "Histogram of the execution time for each outbound Mongo query"},
		l7.ProtocolKafka:     {Name: "container_kafka_requests_duration_seconds_total", Help: "Histogram of the execution time for each outbound Kafka request"},
		l7.ProtocolCassandra: {Name: "container_cassandra_queries_duration_seconds_total", Help: "Histogram of the execution time for each outbound Cassandra request"},
		l7.ProtocolDubbo2:    {Name: "container_dubbo_requests_duration_seconds_total", Help: "Histogram of the response time for each outbound DUBBO request"},
	}
)

Functions

func ContainerdInit

func ContainerdInit() error

func CrioInit added in v1.8.8

func CrioInit() error

func DockerdInit

func DockerdInit() error

func FindNetworkLoadBalancerNs added in v1.8.4

func FindNetworkLoadBalancerNs(networkId string) netns.NsHandle

func JournaldInit

func JournaldInit() error

func JournaldSubscribe

func JournaldSubscribe(cg *cgroup.Cgroup, ch chan<- logparser.LogEntry) error

func JournaldUnsubscribe

func JournaldUnsubscribe(cg *cgroup.Cgroup)

func TaskstatsInit

func TaskstatsInit() error

func TaskstatsPID

func TaskstatsPID(pid uint32) (*taskstats.Stats, error)

func TaskstatsTGID

func TaskstatsTGID(pid uint32) (*taskstats.Stats, error)

Types

type ActiveConnection added in v1.2.0

type ActiveConnection struct {
	Dest       netaddr.IPPort
	ActualDest netaddr.IPPort
	Pid        uint32
	Fd         uint64
	Timestamp  uint64
	Closed     time.Time
	// contains filtered or unexported fields
}

type AddrPair

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

type Conntrack added in v1.2.2

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

func NewConntrack added in v1.2.2

func NewConntrack(netNs netns.NsHandle) (*Conntrack, error)

func (*Conntrack) Close added in v1.2.2

func (c *Conntrack) Close() error

func (*Conntrack) GetActualDestination added in v1.2.2

func (c *Conntrack) GetActualDestination(src, dst netaddr.IPPort) *netaddr.IPPort

type Container

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

func NewContainer

func NewContainer(id ContainerID, cg *cgroup.Cgroup, md *ContainerMetadata, hostConntrack *Conntrack, pid uint32) (*Container, error)

func (*Container) Close

func (c *Container) Close()

func (*Container) Collect

func (c *Container) Collect(ch chan<- prometheus.Metric)

func (*Container) Dead

func (c *Container) Dead(now time.Time) bool

func (*Container) Describe

func (c *Container) Describe(ch chan<- *prometheus.Desc)

type ContainerID

type ContainerID string

type ContainerMetadata

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

func ContainerdInspect

func ContainerdInspect(containerID string) (*ContainerMetadata, error)

func CrioInspect added in v1.8.8

func CrioInspect(containerID string) (*ContainerMetadata, error)

func DockerdInspect

func DockerdInspect(containerID string) (*ContainerMetadata, error)

type ContainerNetwork added in v1.8.4

type ContainerNetwork struct {
	NetworkID string
}

type CrioContainerInfo added in v1.8.8

type CrioContainerInfo struct {
	Name            string            `json:"name"`
	Image           string            `json:"image"`
	Labels          map[string]string `json:"labels"`
	LogPath         string            `json:"log_path"`
	CrioAnnotations map[string]string `json:"crio_annotations"`
}

type CrioVolume added in v1.8.8

type CrioVolume struct {
	ContainerPath string `json:"container_path"`
	HostPath      string `json:"host_path"`
}

type Delays

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

type DotNetMonitor added in v1.16.0

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

func NewDotNetMonitor added in v1.16.0

func NewDotNetMonitor(ctx context.Context, pid uint32, appName string) *DotNetMonitor

func (*DotNetMonitor) Collect added in v1.16.0

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

type L7Metrics added in v1.12.0

type L7Metrics struct {
	Requests *prometheus.CounterVec
	Latency  prometheus.Histogram
}

type L7Stats added in v1.2.0

type L7Stats map[l7.Protocol]map[AddrPair]*L7Metrics // protocol -> dst:actual_dst -> metrics

type ListenDetails added in v1.8.6

type ListenDetails struct {
	ClosedAt time.Time
	NsIPs    []netaddr.IP
}

type LogParser

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

func (*LogParser) Stop

func (p *LogParser) Stop()

type PidFd added in v1.14.0

type PidFd struct {
	Pid uint32
	Fd  uint64
}

type Process added in v1.8.6

type Process struct {
	Pid       uint32
	StartedAt time.Time
	NetNsId   string
	// contains filtered or unexported fields
}

func NewProcess added in v1.16.0

func NewProcess(pid uint32, stats *taskstats.Stats) *Process

func (*Process) Close added in v1.16.0

func (p *Process) Close()

type ProcessInfo added in v1.15.0

type ProcessInfo struct {
	Pid         uint32
	ContainerId ContainerID
	StartedAt   time.Time
}

type Registry

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

func NewRegistry

func NewRegistry(reg prometheus.Registerer, kernelVersion string, processInfoCh chan<- ProcessInfo) (*Registry, error)

func (*Registry) Close

func (r *Registry) Close()

Jump to

Keyboard shortcuts

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