Documentation
¶
Overview ¶
Package googlecloudlogk8snode_contract defines the contract for the googlecloudlogk8snode task.
Index ¶
Constants ¶
const (
// TaskIDPrefix is the prefix for all task IDs in this package.
TaskIDPrefix = "cloud.google.com/log/k8s-node/"
)
Variables ¶
var ( // RevisionStateComponentRunning represents that a node component is running successfully. RevisionStateComponentRunning = style.MustRegisterRevisionState( "Component is running", "check_circle", "The node component (e.g., kubelet, kube-proxy) is running normally.", style.MustForceConvertSRGBHex("#00cc66"), pb.RevisionStateStyle_REVISION_STATE_STYLE_NORMAL, ) // RevisionStateComponentTerminated represents that a node component has terminated or stopped. RevisionStateComponentTerminated = style.MustRegisterRevisionState( "Component is terminated", "cancel", "The node component has terminated or stopped.", style.MustForceConvertSRGBHex("#ff3333"), pb.RevisionStateStyle_REVISION_STATE_STYLE_DELETED, ) )
var ClusterIdentityTaskID = taskid.NewDefaultImplementationID[googlecloudk8scommon_contract.GoogleCloudClusterIdentity](TaskIDPrefix + "cluster-identity")
ClusterIdentityTaskID is the task id for aliasing the cluster identity.
var CommonFieldsetReaderTaskID = taskid.NewDefaultImplementationID[[]*log.Log](TaskIDPrefix + "common-fieldset-reader")
CommonFieldsetReaderTaskID is the ID for a task to read the fieldset used by all parsers in node log parsers later.
var ContainerIDDiscoveryTaskID = taskid.NewDefaultImplementationID[commonlogk8saudit_contract.ContainerIDToContainerIdentity](TaskIDPrefix + "container-id-discovery")
var ContainerdLogFilterTaskID = taskid.NewDefaultImplementationID[[]*log.Log](TaskIDPrefix + "containerd-log-filter")
ContainerdLogFilterTaskID is the ID for a task to filter only the logs for containerd.
var ContainerdLogGroupTaskID = taskid.NewDefaultImplementationID[inspectiontaskbase.LogGroupMap](TaskIDPrefix + "containerd-log-group")
ContainerdLogGroupTaskID is the ID for a task to group containerd related logs based on instance names.
var ContainerdLogLogToTimelineMapperTaskID = taskid.NewDefaultImplementationID[struct{}](TaskIDPrefix + "containerd-log-timeline-mapper")
ContainerdLogLogToTimelineMapperTaskID is the ID for a task to add events or revisions based on containerd logs.
var KubeletLogFilterTaskID = taskid.NewDefaultImplementationID[[]*log.Log](TaskIDPrefix + "kubelet-log-filter")
KubeletLogFilterTaskID is the ID for a task to filter only the logs for kubelet.
var KubeletLogGroupTaskID = taskid.NewDefaultImplementationID[inspectiontaskbase.LogGroupMap](TaskIDPrefix + "kubelet-log-group")
KubeletLogGroupTaskID is the ID for a task to group kubelet related logs based on instance names.
var KubeletLogLogToTimelineMapperTaskID = taskid.NewDefaultImplementationID[struct{}](TaskIDPrefix + "kubelet-log-timeline-mapper")
KubeletLogLogToTimelineMapperTaskID is the ID for a task to add events or revisions based on kubelet logs.
var ListLogEntriesTaskID = taskid.NewDefaultImplementationID[[]*log.Log](TaskIDPrefix + "query")
ListLogEntriesTaskID is the task id for the task that queries k8s node logs from Cloud Logging.
var LogIngesterTaskID = taskid.NewDefaultImplementationID[[]*log.Log](TaskIDPrefix + "log-ingester")
LogIngesterTaskID is the task ID to finalize the logs to be included in the final output.
var (
LogTypeNode = style.MustRegisterLogType("k8s node", "Kubernetes Node Logs", style.MustForceConvertSRGBHex("#0077CC"), style.ColorWhite)
)
The following block defines the registered timeline style LogTypes. These are registered as package-level variables so they are initialized immediately when this package is imported.
var OtherLogFilterTaskID = taskid.NewDefaultImplementationID[[]*log.Log](TaskIDPrefix + "other-log-filter")
OtherLogFilterTaskID is the task ID for filtering other logs.
var OtherLogGroupTaskID = taskid.NewDefaultImplementationID[inspectiontaskbase.LogGroupMap](TaskIDPrefix + "other-log-group")
OtherLogGroupTaskID is the ID for a task to group other related logs based on instance names and component name.
var OtherLogLogToTimelineMapperTaskID = taskid.NewDefaultImplementationID[struct{}](TaskIDPrefix + "other-log-timeline-mapper")
OtherLogLogToTimelineMapperTaskID is the task ID for a task to add events or revisions based on other logs.
var PodSandboxIDDiscoveryTaskID = taskid.NewDefaultImplementationID[patternfinder.PatternFinder[*PodSandboxIDInfo]](TaskIDPrefix + "containerd-id-discovery")
PodSandboxIDDiscoveryTaskID is the ID for a task to extract pod sandbox IDs for the other parsers to corelate a log to Pods.
var TailTaskID = taskid.NewDefaultImplementationID[struct{}](TaskIDPrefix + "tail")
TailTaskID is a nop task just to require all child parsers.
var ( TimelineTypeNodeComponent = style.MustRegisterTimelineType( "node-component", "Logs of non-containerized system components on the node", "manufacturing", 0.6, style.ColorWhite, style.ColorBlack, style.MustForceConvertSRGBHex("#0077CC"), style.ColorWhite, true, 6000, style.AlphabeticalSortPolicy(), ) )
The following block defines the registered timeline style TimelineTypes. These are registered as package-level variables so they are initialized immediately when this package is imported.
Functions ¶
func MustNodeComponentTimeline ¶ added in v0.56.0
func MustNodeComponentTimeline(ctx context.Context, nodeTimeline *khifilev6.TimelinePath, componentName string) *khifilev6.TimelinePath
MustNodeComponentTimeline returns the timeline path for a node component (e.g., containerd, kubelet).
Types ¶
type K8sNodeLogCommonFieldSet ¶
type K8sNodeLogCommonFieldSet struct {
Message *logutil.ParseStructuredLogResult
Component string
NodeName string
}
func (*K8sNodeLogCommonFieldSet) Kind ¶
func (k *K8sNodeLogCommonFieldSet) Kind() string
Kind implements log.FieldSet.
func (*K8sNodeLogCommonFieldSet) ParserType ¶
func (k *K8sNodeLogCommonFieldSet) ParserType() K8sNodeParserType
type K8sNodeLogCommonFieldSetReader ¶
type K8sNodeLogCommonFieldSetReader struct {
StructuredLogParser logutil.StructuredLogParser
}
func (*K8sNodeLogCommonFieldSetReader) FieldSetKind ¶
func (k *K8sNodeLogCommonFieldSetReader) FieldSetKind() string
FieldSetKind implements log.FieldSetReader.
func (*K8sNodeLogCommonFieldSetReader) Read ¶
func (k *K8sNodeLogCommonFieldSetReader) Read(reader *structured.NodeReader) (log.FieldSet, error)
Read implements log.FieldSetReader.
type K8sNodeParserType ¶
type K8sNodeParserType string
var ( Containerd K8sNodeParserType = "containerd" Kubelet K8sNodeParserType = "kubelet" Other K8sNodeParserType = "other" )