common

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 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"

	// App name keys in the observability bundle
	AlloyLogsObservabilityBundleAppName   = "alloyLogs"
	AlloyEventsObservabilityBundleAppName = "alloyEvents"

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

	PriorityClassName = "giantswarm-critical"

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

	// 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 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.0

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

Read Tempo URL from ingress

Types

type ClusterLabels added in v0.37.0

type ClusterLabels struct {
	ClusterID    string
	ClusterType  string
	Installation string
	Organization string
	Provider     string
}

ClusterLabels holds the extracted cluster labels used in templates

func ExtractClusterLabels added in v0.37.0

func ExtractClusterLabels(ctx context.Context, k8sClient client.Client, cluster *capi.Cluster, appConfig config.Config) (ClusterLabels, error)

ExtractClusterLabels extracts all the cluster labels used in templates

Jump to

Keyboard shortcuts

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