From d28a4bec05eae7b0c871dd5caa5f45a5c37240d3 Mon Sep 17 00:00:00 2001 From: rasmus Date: Wed, 9 Nov 2022 20:45:44 +0200 Subject: [PATCH] drop line if can't parse --- pkg/lines/lines_single.go | 3 ++- pkg/watcher/watcher.go | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/lines/lines_single.go b/pkg/lines/lines_single.go index a573e12..93b3ccf 100644 --- a/pkg/lines/lines_single.go +++ b/pkg/lines/lines_single.go @@ -22,9 +22,10 @@ func (unparsed RawC) parse(parsed chan<- singleLine) { if err := line.parse(); err != nil { promRecordPrefixParsingErr.WithLabelValues(raw.MetricsName).Add(1) log.Printf("parsing kubernetes log line in %q: %e", raw.File.Path, err) + + continue } - // TODO: should this only be on success? parsed <- line } } diff --git a/pkg/watcher/watcher.go b/pkg/watcher/watcher.go index acaa32a..d628290 100644 --- a/pkg/watcher/watcher.go +++ b/pkg/watcher/watcher.go @@ -30,9 +30,9 @@ var App = &cli.App{ // //TODO: &cli.BoolFlag{Name: "normalize-log-level", Usage: "Normalize log.level values to Syslog defined keywords"}, //TODO: &cli.BoolFlag{Name: "parse-json"}, - // TODO: - &cli.StringFlag{Category: "k8s metadata", Name: "pod-namespace", EnvVars: []string{"KUBE_POD_NAMESPACE"}}, - &cli.StringFlag{Category: "k8s metadata", Name: "node-name", EnvVars: []string{"KUBE_NODE_NAME"}, Required: true}, + // + // &cli.StringFlag{Category: "k8s metadata", Name: "pod-namespace", EnvVars: []string{"KUBE_POD_NAMESPACE"}}, + // &cli.StringFlag{Category: "k8s metadata", Name: "node-name", EnvVars: []string{"KUBE_NODE_NAME"}, Required: true}, // &cli.StringFlag{Category: "secrets", Name: "mongo-uri", EnvVars: []string{"MONGO_URI"}, Usage: "mongodb://foo:bar@host:27017/database", Required: true}, },