logcollector

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// ContainerName is the name of the Fluent Bit sidecar.
	ContainerName = apiv1.LogCollectorContainerName

	// Component is the last segment of the Fluent Bit tag.
	Component = "mysql"

	// EnabledEnvVar tells ps-entrypoint.sh to point log_error at a file on the
	// data volume instead of leaving it on stderr.
	EnabledEnvVar = "LOG_COLLECTOR_ENABLED"

	// LogDirEnvVar holds the directory that mysqld writes its logs to.
	LogDirEnvVar = "LOG_DIR"

	// HTTPPort is the port Fluent Bit's HTTP server listens on.
	HTTPPort = 2020

	// LogDirName is the log directory, relative to the MySQL data directory. It
	// lives on the data volume so the logs survive a pod restart.
	LogDirName = "log"
)

Variables

This section is empty.

Functions

func ConfigHash

func ConfigHash(ctx context.Context, cl client.Client, cr *apiv1.PerconaServerMySQL) (string, error)

ConfigHash digests the log collector configuration, including the contents of the ConfigMaps it references.

func ConfigMapName

func ConfigMapName(prefix string) string

ConfigMapName returns the name of the ConfigMap holding the custom Fluent Bit configuration.

func Containers

func Containers(cr *apiv1.PerconaServerMySQL, dataMount, backupLogsMount corev1.VolumeMount) []corev1.Container

Containers returns the Fluent Bit and logrotate sidecars for a MySQL pod. dataMount is the MySQL data volume, which holds the logs to tail; backupLogsMount is the xtrabackup sidecar's log volume on the same pod.

func InitEnv

func InitEnv(cr *apiv1.PerconaServerMySQL) []corev1.EnvVar

InitEnv returns the environment the init container needs so it can fail loudly when log collection is on but the init image does not ship the log collector assets, instead of leaving the sidecars to crash-loop on a missing entrypoint.

func LogDir

func LogDir(dataMountPath string) string

LogDir returns the directory mysqld writes its logs to.

func MySQLEnv

func MySQLEnv(cr *apiv1.PerconaServerMySQL, dataMountPath string) []corev1.EnvVar

MySQLEnv returns the environment the mysqld container needs so its entrypoint writes the error log to a file the collector can tail.

func Reconcile

func Reconcile(ctx context.Context, cl client.Client, cr *apiv1.PerconaServerMySQL) error

Reconcile reconciles the ConfigMaps backing the log collector configuration.

func Volumes

func Volumes(cr *apiv1.PerconaServerMySQL) []corev1.Volume

Volumes returns the pod-level volumes the log collector sidecars require. The log directory itself needs no volume of its own: it lives on the data volume the MySQL pod already mounts.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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