labels

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package labels provides constant definitions for Kubernetes labels used across the Choreo logging system. This centralizes label definitions to eliminate magic strings and improve maintainability.

Index

Constants

View Source
const (
	// ComponentID identifies the specific microservice/component
	ComponentID = "openchoreo.dev/component-uid"

	// EnvironmentID identifies the deployment environment (dev, test, staging, prod, etc.)
	EnvironmentID = "openchoreo.dev/environment-uid"

	// ProjectID identifies the project that groups multiple components
	ProjectID = "openchoreo.dev/project-uid"

	// ComponentName is the human-readable component name
	ComponentName = "openchoreo.dev/component"

	// EnvironmentName is the human-readable environment name
	EnvironmentName = "openchoreo.dev/environment"

	// ProjectName is the human-readable project name
	ProjectName = "openchoreo.dev/project"

	// Version is the human-readable version string (e.g., "v1.2.3")
	Version = "version"

	// VersionID is the unique deployment version identifier (UUID)
	VersionID = "version_id"

	// NamespaceName identifies the namespace that owns the resources
	NamespaceName = "openchoreo.dev/namespace"

	// PipelineID identifies the CI/CD pipeline that deployed the component
	PipelineID = "pipeline-id"

	// RunID identifies the specific execution run of a pipeline
	RunID = "run_id"

	// WorkflowName identifies the build/deployment workflow
	WorkflowName = "workflow_name"

	// BuildID identifies the specific build instance
	BuildID = "build-name"

	// BuildUUID identifies the unique build identifier (UUID)
	BuildUUID = "uuid"

	// Target identifies the target log category (build, runtime, gateway)
	Target = "target"
)

Kubernetes label keys used for log filtering and identification across all logging components. These labels are applied to Kubernetes resources and used by: - OpenSearch queries for log filtering - AWS CloudWatch log queries - Azure Log Analytics queries - Log enrichment processes

View Source
const (
	// TargetBuild identifies build logs
	TargetBuild = "build"

	// TargetRuntime identifies runtime logs
	TargetRuntime = "runtime"

	// TargetGateway identifies gateway logs
	TargetGateway = "gateway"
)

Target value constants for different log types

View Source
const (
	// QueryParamLogTypeBuild identifies build log queries
	QueryParamLogTypeBuild = "BUILD"

	// QueryParamLogTypeRuntime identifies runtime log queries
	QueryParamLogTypeRuntime = "RUNTIME"
)

Query parameter constants for log types

View Source
const (
	// KubernetesLabelsPrefix is the base path for all Kubernetes labels in OpenSearch documents
	KubernetesPrefix        = "kubernetes"
	KubernetesLabelsPrefix  = KubernetesPrefix + ".labels"
	KubernetesPodName       = KubernetesPrefix + ".pod_name"
	KubernetesContainerName = KubernetesPrefix + ".container_name"
	KubernetesNamespaceName = KubernetesPrefix + ".namespace_name"
)

OpenSearch field paths for querying Kubernetes labels in log documents

Variables

OpenSearch field paths with dots replaced by underscores in label keys

View Source
var CICDLabels = []string{
	PipelineID,
	RunID,
	WorkflowName,
}

CICDLabels are the CI/CD related labels used for build and deployment log tracking

View Source
var RequiredLabels = []string{
	ComponentID,
	EnvironmentID,
	ProjectID,
}

RequiredLabels are the required labels that must be present on all Choreo components for proper log filtering

View Source
var VersioningLabels = []string{
	Version,
	VersionID,
}

VersioningLabels are the versioning labels used for deployment tracking and rollback scenarios

Functions

func ReplaceDots added in v0.15.0

func ReplaceDots(s string) string

ReplaceDots replaces dots with underscores in a string This is used to match Fluent-Bit's Replace_Dots behavior in the OpenSearch output plugin.

Types

This section is empty.

Jump to

Keyboard shortcuts

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