k8s

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package k8s contains options for including labels from the Kubernetes Downward API podinfo labels file in logging records.

Placing the options in a separate package minimizes the dependencies pulled in by those who do not need labels from the Kubernetes Downward API.

Index

Constants

View Source
const (
	// PodPrefix is the prefix for labels obtained from the Kubernetes
	// Downward API podinfo labels file.
	PodPrefix = "k8s-pod/"
)

Variables

This section is empty.

Functions

func WithPodinfoLabels

func WithPodinfoLabels(root string) options.OptionProcessor

WithPodinfoLabels returns a Option that directs that the slog.Handler to include labels from the Kubernetes Downward API podinfo labels file. The labels file is expected to be found in the directory specified by root and MUST be named "labels", per the Kubernetes Downward API for Pods.

The labels are prefixed with "k8s-pod/" to adhere to the Google Cloud Logging conventions for Kubernetes Pod labels.

Types

This section is empty.

Jump to

Keyboard shortcuts

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