common

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LoggingEnabledDefault defines if WCs logs are collected by default
	LoggingEnabledDefault = true

	// ReadUser is the global user for reading logs
	ReadUser = "read"
	// DefaultWriteTenant is the default tenant for writing logs
	DefaultWriteTenant = "giantswarm"

	// Possible values for --logging-agent flag.
	LoggingAgentPromtail = "promtail"
	LoggingAgentAlloy    = "alloy"

	// Possible values for --events-logger flag.
	EventsLoggerAlloy        = "alloy"
	EventsLoggerGrafanaAgent = "grafana-agent"

	// App name keys in the observability bundle
	AlloyObservabilityBundleAppName    = "alloyLogs"
	PromtailObservabilityBundleAppName = "promtail"

	// Alloy app name and namespace when using Alloy as logging agent.
	AlloyLogAgentAppName      = "alloy-logs"
	AlloyLogAgentAppNamespace = "kube-system"

	PriorityClassName = "giantswarm-critical"

	// Alloy app name and namespace when using Alloy as events logger.
	AlloyEventsLoggerAppName      = "alloy-events"
	AlloyEventsLoggerAppNamespace = "kube-system"

	// LokiMaxBackoffPeriod specifies the maximum retry backoff duration for Loki writes.
	LokiMaxBackoffPeriod = 10 * time.Minute
	// LokiRemoteTimeout configures the write timeout for remote Loki endpoints.
	LokiRemoteTimeout = 60 * time.Second

	LokiBaseURLFormat = "https://%s"

	LokiPushURLFormat = LokiBaseURLFormat + lokiAPIV1PushPath

	LoggingURL      = "logging-url"
	LoggingTenantID = "logging-tenant-id"
	LokiRulerAPIURL = "ruler-api-url"

	// Logging credentials keys for Alloy config
	LoggingUsername = "logging-username"
	LoggingPassword = "logging-password"

	// Tracing credentials keys for Alloy config
	TracingUsername = "tracing-username"
	TracingPassword = "tracing-password"
)

Variables

This section is empty.

Functions

func AddCommonLabels

func AddCommonLabels(labels map[string]string)

func AppConfigName added in v0.30.0

func AppConfigName(cluster *capi.Cluster, app string) string

AppConfigName generates an app config name for the given cluster and app. This function can work with any cluster object.

func GetObservabilityBundleAppVersion added in v0.5.1

func GetObservabilityBundleAppVersion(ctx context.Context, client client.Client, cluster *capi.Cluster) (version semver.Version, err error)

func GrafanaAgentExtraSecretName added in v0.2.0

func GrafanaAgentExtraSecretName() string

func IsLoggingEnabled

func IsLoggingEnabled(cluster *capi.Cluster, enableLoggingFlag bool) bool

func IsWorkloadCluster added in v0.0.4

func IsWorkloadCluster(installationName, clusterName string) bool

func ObservabilityBundleAppMeta added in v0.1.3

func ObservabilityBundleAppMeta(cluster *capi.Cluster) metav1.ObjectMeta

ObservabilityBundleAppMeta returns metadata for the observability bundle app.

func ObservabilityBundleConfigMapMeta added in v0.1.3

func ObservabilityBundleConfigMapMeta(cluster *capi.Cluster) metav1.ObjectMeta

ObservabilityBundleConfigMapMeta returns metadata for the observability bundle extra values configmap.

func ReadLokiIngressURL added in v0.2.0

func ReadLokiIngressURL(ctx context.Context, cluster *capi.Cluster, client client.Client) (string, error)

Read Loki URL from ingress

func ReadTempoIngressURL added in v0.31.1

func ReadTempoIngressURL(ctx context.Context, cluster *capi.Cluster, client client.Client) (string, error)

Read Tempo URL from ingress

Types

type LoggingAgent added in v0.30.0

type LoggingAgent struct {
	LoggingAgent     string
	KubeEventsLogger string
}

func ToggleAgents added in v0.25.0

func ToggleAgents(ctx context.Context, client client.Client, cluster *capi.Cluster, cfg config.Config) (*LoggingAgent, error)

func (*LoggingAgent) GetKubeEventsLogger added in v0.30.0

func (la *LoggingAgent) GetKubeEventsLogger() string

func (*LoggingAgent) GetLoggingAgent added in v0.30.0

func (la *LoggingAgent) GetLoggingAgent() string

func (*LoggingAgent) SetKubeEventsLogger added in v0.30.0

func (la *LoggingAgent) SetKubeEventsLogger(kubeEventsLogger string)

func (*LoggingAgent) SetLoggingAgent added in v0.30.0

func (la *LoggingAgent) SetLoggingAgent(loggingAgent string)

Jump to

Keyboard shortcuts

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