Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRI metada parsing failures using logsCollection #376

Closed
povilasv opened this issue Sep 20, 2022 · 0 comments
Closed

CRI metada parsing failures using logsCollection #376

povilasv opened this issue Sep 20, 2022 · 0 comments
Labels
bug Something isn't working chart:collector Issue related to opentelemetry-collector helm chart

Comments

@povilasv
Copy link
Contributor

I get quite a lot of regex pattern does not match errors when using logsCollection preset. Detailed log is below.

What I checked is:

/var/log/pods/kube-system_etcd-rock64-0_2b37ad500d0bbd0af1cb51af3d8b9dd1/etcd/104.log

Does not match regex:

^.*\/(?P<namespace>[^_]+)_(?P<pod_name>[^_]+)_(?P<uid>[a-f0-9\-]{36})\/(?P<container_name>[^\._]+)\/(?P<restart_count>\d+)\.log$

Because uid is 32 chars long, not 36?

I tried looking at Kubernetes code, but couldn't figure out what is the typical length

Detailed long:

2022-09-19T17:20:09.945Z        error   helper/transformer.go:110       Failed to process entry {"kind": "receiver", "name": "filelog", "pipeline": "logs", "operator_id": "extract_metadata_from_filepath", "operator_type": "regex_parser", "error": "regex pattern does not match", "action": "send", "entry": {"observed_timestamp":"2022-09-19T17:20:09.945292155Z","timestamp":"2022-09-19T17:20:09.817869461Z","body":"2022-09-19T17:20:09.817869461Z stderr F {\"level\":\"warn\",\"ts\":\"2022-09-19T17:20:09.817Z\",\"caller\":\"embed/config_logging.go:169\",\"msg\":\"rejected connection\",\"remote-addr\":\"192.168.1.46:22836\",\"server-name\":\"\",\"error\":\"tls: first record does not look like a TLS handshake\"}","attributes":{"log":"{\"level\":\"warn\",\"ts\":\"2022-09-19T17:20:09.817Z\",\"caller\":\"embed/config_logging.go:169\",\"msg\":\"rejected connection\",\"remote-addr\":\"192.168.1.46:22836\",\"server-name\":\"\",\"error\":\"tls: first record does not look like a TLS handshake\"}","log.file.path":"/var/log/pods/kube-system_etcd-rock64-0_2b37ad500d0bbd0af1cb51af3d8b9dd1/etcd/104.log","logtag":"F","stream":"stderr","time":"2022-09-19T17:20:09.817869461Z"},"severity":0,"scope_name":""}}
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.(*TransformerOperator).HandleEntryError
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper/transformer.go:110
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.(*ParserOperator).ParseWith
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper/parser.go:152
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.(*ParserOperator).ProcessWithCallback
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper/parser.go:124
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.(*ParserOperator).ProcessWith
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper/parser.go:110
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/regex.(*Parser).Process
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/regex/regex.go:110
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.(*WriterOperator).Write
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper/writer.go:65
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.(*ParserOperator).ProcessWithCallback
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper/parser.go:134
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.(*ParserOperator).ProcessWith
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper/parser.go:110
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/regex.(*Parser).Process
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/regex/regex.go:110
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/transformer/router.(*Transformer).Process
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/transformer/router/router.go:142
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.(*WriterOperator).Write
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper/writer.go:65
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/file.(*Input).emit
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/file/file.go:65
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer.(*Reader).ReadToEnd
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/reader.go:85
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer.(*Manager).consume.func1
        /home/povilasv/gocode/src/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/file.go:137

@TylerHelmuth TylerHelmuth added bug Something isn't working chart:collector Issue related to opentelemetry-collector helm chart labels Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chart:collector Issue related to opentelemetry-collector helm chart
Projects
None yet
Development

No branches or pull requests

2 participants