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 ¶
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.