common

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package common provides shared utilities and components for Alloy agent configuration.

This package contains common functionality used across different Alloy agent types (metrics, logs, events) including:

  • Secret template generation for agent credentials and configuration
  • Shared label constants and utilities
  • Common configuration patterns

The common package promotes code reuse and consistency across all agent types while maintaining a clear separation of concerns.

Index

Constants

View Source
const (
	// PriorityClassName is the pod priority class for critical Alloy agent workloads
	PriorityClassName = "giantswarm-critical"

	// LokiBaseURLFormat is the base URL template for Loki write endpoints
	LokiBaseURLFormat = "https://write.loki.%s"
	// LokiPushURLFormat is the full URL template for Loki's push API
	LokiPushURLFormat = LokiBaseURLFormat + "/loki/api/v1/push"

	// Loki secret keys for authentication and endpoint configuration
	LokiURLKey         = "logging-url"       // URL for Loki push endpoint
	LokiTenantIDKey    = "logging-tenant-id" // Tenant ID for multi-tenancy
	LokiUsernameKey    = "logging-username"  // Username for basic auth
	LokiPasswordKey    = "logging-password"  // Password for basic auth
	LokiRulerAPIURLKey = "ruler-api-url"     // URL for Loki ruler API

	// Loki performance tuning parameters
	LokiMaxBackoffPeriod = "10m" // Maximum backoff period for retries
	LokiRemoteTimeout    = "60s" // Timeout for remote write operations

	// Tempo secret keys for authentication
	TempoUsernameKey = "tracing-username" // Username for Tempo authentication
	TempoPasswordKey = "tracing-password" // Password for Tempo authentication

	// TempoIngressURLFormat is the URL template for Tempo ingress
	TempoIngressURLFormat = "tempo.%s"

	// Mimir default values and URL templates
	MimirRemoteWriteName              = "mimir"                             // Default remote write name
	MimirBaseURLFormat                = "https://mimir.%s"                  // Base URL template for Mimir
	MimirRemoteWriteEndpointURLFormat = MimirBaseURLFormat + "/api/v1/push" // Full remote write endpoint URL
	MimirQueryEndpointURLFormat       = MimirBaseURLFormat + "/prometheus"  // Prometheus-compatible query endpoint for KEDA
	MimirRemoteWriteTimeout           = "60s"                               // Timeout for remote write operations

	// Mimir secret keys for remote write configuration and authentication
	MimirQueryAPIURLKey            = "mimirQueryAPIURL"            // URL for Mimir query endpoint
	MimirRulerAPIURLKey            = "mimirRulerAPIURL"            // URL for Mimir ruler API
	MimirRemoteWriteAPIUsernameKey = "mimirRemoteWriteAPIUsername" // Username for remote write auth
	MimirRemoteWriteAPIPasswordKey = "mimirRemoteWriteAPIPassword" // Password for remote write auth
	MimirRemoteWriteAPIURLKey      = "mimirRemoteWriteAPIURL"      // URL for remote write endpoint
	MimirRemoteWriteAPINameKey     = "mimirRemoteWriteAPIName"     // Name identifier for remote write
)

Variables

This section is empty.

Functions

func GenerateSecretData

func GenerateSecretData(secrets map[string]string, extraObjects string) ([]byte, error)

GenerateSecretData generates the secret data for an Alloy agent using the shared template. It takes a map of environment variable key-value pairs and an optional extraObjects YAML string to include as Helm extraObjects (e.g. KEDA resources). The extraObjects content will be indented under the alloy.extraObjects key in the output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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