Currently for extracting log level from log message we are searching for the firs entrance of `level=` pattern with regexp. Which should work in most cases, however this approach can't properly handle this:
ts=2022-06-14T21:50:00.817Z caller=node_exporter.go:184 msg="naming collision level=error " level=info
Instead of `info` our implementation will extract `error` level. We should investigate how proper logs parsing will affect CPU usage and if it's acceptable switch to it.
Here is some libraries for logfmt format parcing:
Out of scope:
How to test:
- relates to
PMM-10122 pmm-agent log-level match exporters output