logstash-filter-verifier icon indicating copy to clipboard operation
logstash-filter-verifier copied to clipboard

Logstash Config Test Coverage

Open breml opened this issue 4 years ago • 2 comments
trafficstars

If one has larger and more complex Logstash configuration (especially if there is some use of conditions), it gets harder and harder to make sure, one does have a test case for every branch of the configuration and the necessary coverage of the corner cases.

Therefore it would be beneficial, if Logstash Filter Verifier (LFV) would provide some support to track the "code" coverage of the Logstash configuration. The idea here is to use the Logstash pipeline stats (https://www.elastic.co/guide/en/logstash/current/node-stats-api.html#pipeline-stats) after the execution of the test cases to get the details, which filters have been hit. Given every filter has an ID configured, it would be possible to emit the name of the filters, which have not been hit by any test case.

breml avatar Nov 27 '20 08:11 breml

It shouldn't be too hard to generate an HTML file with per-file stats and the configuration under test with non-covered filters marked with a different background color (similar to the output from e.g. gocov-html).

magnusbaeck avatar Nov 28 '20 21:11 magnusbaeck

It shouldn't be too hard to generate an HTML file with per-file stats and the configuration under test with non-covered filters marked with a different background color (similar to the output from e.g. gocov-html).

This is a nice idea. For a first implementation I would focus on the simpler thing and then improve from there.

breml avatar Dec 04 '20 07:12 breml