drop line if can't parse

This commit is contained in:
rasmus 2022-11-09 20:45:44 +02:00
parent 2232a748db
commit d28a4bec05
2 changed files with 5 additions and 4 deletions

View File

@ -22,9 +22,10 @@ func (unparsed RawC) parse(parsed chan<- singleLine) {
if err := line.parse(); err != nil { if err := line.parse(); err != nil {
promRecordPrefixParsingErr.WithLabelValues(raw.MetricsName).Add(1) promRecordPrefixParsingErr.WithLabelValues(raw.MetricsName).Add(1)
log.Printf("parsing kubernetes log line in %q: %e", raw.File.Path, err) log.Printf("parsing kubernetes log line in %q: %e", raw.File.Path, err)
continue
} }
// TODO: should this only be on success?
parsed <- line parsed <- line
} }
} }

View File

@ -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: "normalize-log-level", Usage: "Normalize log.level values to Syslog defined keywords"},
//TODO: &cli.BoolFlag{Name: "parse-json"}, //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: "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: "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}, &cli.StringFlag{Category: "secrets", Name: "mongo-uri", EnvVars: []string{"MONGO_URI"}, Usage: "mongodb://foo:bar@host:27017/database", Required: true},
}, },