containers

package
v0.0.0-...-e70f483 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 10

Documentation

Overview

Package containers implements the functionality needed to fetch metrics from the different runtimes supported (Docker, containerd, etc.).

Package containers provides container-related utilities. Filter types have moved to comp/core/workloadfilter/legacy.

Index

Constants

View Source
const ContainerEntityName = "container_id"

ContainerEntityName is the entity name applied to all containers

View Source
const ContainerEntityPrefix = ContainerEntityName + EntitySeparator

ContainerEntityPrefix is the prefix that any entity corresponding to a container must have It replaces any prior prefix like <runtime>:// in a pod container status.

View Source
const EntitySeparator = "://"

EntitySeparator is used to separate the entity name from its ID

Variables

This section is empty.

Functions

func BuildEntityName

func BuildEntityName(runtime, id string) string

BuildEntityName builds a valid entity name for a given container runtime and cid.

func GetPauseContainerExcludeList deprecated

func GetPauseContainerExcludeList() []string

GetPauseContainerExcludeList returns the exclude list for pause containers.

Deprecated: use comp/core/workloadfilter.Component instead.

func IsEntityName

func IsEntityName(name string) bool

IsEntityName tests whether a given entity name is valid

func IsExcludedByAnnotationInner deprecated

func IsExcludedByAnnotationInner(annotations map[string]string, containerName string, excludePrefix string) bool

IsExcludedByAnnotationInner checks if an entity is excluded by annotations.

Deprecated: use comp/core/workloadfilter.Component instead.

func IsPauseContainer added in v0.9.0

func IsPauseContainer(labels map[string]string) bool

IsPauseContainer returns whether a container is a pause container based on the container labels This util can be used to exclude pause container in best-effort Note: Pause containers can still be excluded based on the image name via the container filtering module

func PreprocessImageFilter deprecated

func PreprocessImageFilter(imageFilter string) string

PreprocessImageFilter modifies image filters to handle strict matches without tags.

Deprecated: use comp/core/workloadfilter.Component instead.

func ShortContainerID

func ShortContainerID(containerID string) string

ShortContainerID shortens the container identifier.

func SplitEntityName

func SplitEntityName(name string) (string, string)

SplitEntityName returns the prefix and container cid parts of a valid entity name

Types

type EnvFilter

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

EnvFilter defines a filter for environment variables

func EnvVarFilterFromConfig

func EnvVarFilterFromConfig() EnvFilter

EnvVarFilterFromConfig returns an EnvFilter based on the options present in the config

func (EnvFilter) IsIncluded

func (f EnvFilter) IsIncluded(envVarName string) bool

IsIncluded returns whether the given env variable name is included

type Filter deprecated

type Filter = legacy.Filter

Filter holds the state for the container filtering logic.

Deprecated: use comp/core/workloadfilter.Component instead.

func GetPauseContainerFilter deprecated added in v0.9.0

func GetPauseContainerFilter(excludePause bool) (*Filter, error)

GetPauseContainerFilter returns a filter that excludes pause containers when excludePause is true. The excludePause value should come from the "exclude_pause_container" config key.

Deprecated: use comp/core/workloadfilter.Component instead.

func NewFilter deprecated

func NewFilter(ft FilterType, includeList, excludeList []string) (*Filter, error)

NewFilter creates a new container filter from include and exclude pattern slices.

Deprecated: use comp/core/workloadfilter.Component instead.

type FilterType deprecated

type FilterType = legacy.FilterType

FilterType indicates the container filter type.

Deprecated: use comp/core/workloadfilter.Component instead.

const (
	// GlobalFilter is used to cover both MetricsFilter and LogsFilter filter types.
	//
	// Deprecated: use comp/core/workloadfilter.Component instead.
	GlobalFilter FilterType = legacy.GlobalFilter
	// MetricsFilter refers to the Metrics filter type.
	//
	// Deprecated: use comp/core/workloadfilter.Component instead.
	MetricsFilter FilterType = legacy.MetricsFilter
	// LogsFilter refers to the Logs filter type.
	//
	// Deprecated: use comp/core/workloadfilter.Component instead.
	LogsFilter FilterType = legacy.LogsFilter

	// KubeNamespaceFilterPrefix is the prefix used for Kubernetes namespaces.
	//
	// Deprecated: use comp/core/workloadfilter.Component instead.
	KubeNamespaceFilterPrefix = legacy.KubeNamespaceFilterPrefix
)

Directories

Path Synopsis
image module
Package containers provides metadata for containers.
Package containers provides metadata for containers.
Package metrics registers all the different collectors for container-related metrics.
Package metrics registers all the different collectors for container-related metrics.
containerd
Package containerd implements the containerd metrics collector
Package containerd implements the containerd metrics collector
cri
Package cri implements the CRI metrics collector.
Package cri implements the CRI metrics collector.
docker
Package docker implements the Docker metrics collector.
Package docker implements the Docker metrics collector.
ecsfargate
Package ecsfargate implements the ECS Fargate metrics collector.
Package ecsfargate implements the ECS Fargate metrics collector.
ecsmanagedinstances
Package ecsmanagedinstances implements the ECS Managed Instances metrics collector.
Package ecsmanagedinstances implements the ECS Managed Instances metrics collector.
kubelet
Package kubelet implements the Kubelet metrics collector.
Package kubelet implements the Kubelet metrics collector.
provider
Package provider defines the Provider interface which allows to get metrics collectors for the different container runtimes supported (Docker, containerd, etc.).
Package provider defines the Provider interface which allows to get metrics collectors for the different container runtimes supported (Docker, containerd, etc.).
system
Package system implements the system metrics collector, which is based on Linux cgroups.
Package system implements the system metrics collector, which is based on Linux cgroups.

Jump to

Keyboard shortcuts

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