netobserv / flowlogs-pipeline

Transform flow logs into metrics
Apache License 2.0
75 stars 23 forks source link

Add new filters allowing FLP-based dedup #640

Closed jotak closed 3 months ago

jotak commented 6 months ago

Note this PR is based on 2 other non-merged PRs - commit https://github.com/netobserv/flowlogs-pipeline/commit/ae226f9826f46df792cd78174c8a87b80eebcafe is the significant one

Description

Breaking change

The configuration of the removeEntryIfXXX rules is modified, they now all share the same key for additional configuration, which is named removeEntry

For example, a rule previously written as:

      filter:
        rules:
        - type: remove_entry_if_exists
          removeEntryIfExists:
            input: srcPort

must be changed to:

      filter:
        rules:
        - type: remove_entry_if_exists
          removeEntry:
            input: srcPort

Same applies to rules of type remove_entry_if_doesnt_exist, remove_entry_if_equal and remove_entry_if_not_equal.

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

jotak commented 6 months ago

Resource footprints look good: https://docs.google.com/spreadsheets/d/1qakBaK1dk_rERO30k1cSR4W-Nn0SXW4A3lqQ1sZC4rE/edit#gid=705512397 I ran two scenarios, one for dropping duplicates and another for sampling 1:50 duplicates. => both of them show around -30% CPU/memory/storage usage by Loki; FLP CPU decreased by ~12% and FLP memory decreased by 16% in drop scenario and 10% in sampling scenario.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 76.92308% with 27 lines in your changes are missing coverage. Please review.

Project coverage is 67.41%. Comparing base (d2b2352) to head (fb76a92).

Files Patch % Lines
pkg/api/transform_filter.go 46.15% 11 Missing and 3 partials :warning:
pkg/pipeline/transform/transform_filter.go 85.71% 10 Missing and 3 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #640 +/- ## ========================================== - Coverage 67.41% 67.41% -0.01% ========================================== Files 102 103 +1 Lines 7589 7641 +52 ========================================== + Hits 5116 5151 +35 - Misses 2162 2176 +14 - Partials 311 314 +3 ``` | [Flag](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/640/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/640/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | `67.41% <76.92%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter commented 5 months ago

Codecov Report

Attention: Patch coverage is 76.92308% with 27 lines in your changes missing coverage. Please review.

Project coverage is 67.41%. Comparing base (d2b2352) to head (fb76a92). Report is 27 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #640 +/- ## ========================================== - Coverage 67.41% 67.41% -0.01% ========================================== Files 102 103 +1 Lines 7589 7641 +52 ========================================== + Hits 5116 5151 +35 - Misses 2162 2176 +14 - Partials 311 314 +3 ``` | [Flag](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/640/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/640/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | `67.41% <76.92%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/640?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | Coverage Δ | | |---|---|---| | [pkg/pipeline/transform/transform\_filter.go](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/640?src=pr&el=tree&filepath=pkg%2Fpipeline%2Ftransform%2Ftransform_filter.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#diff-cGtnL3BpcGVsaW5lL3RyYW5zZm9ybS90cmFuc2Zvcm1fZmlsdGVyLmdv) | `88.98% <85.71%> (-0.15%)` | :arrow_down: | | [pkg/api/transform\_filter.go](https://app.codecov.io/gh/netobserv/flowlogs-pipeline/pull/640?src=pr&el=tree&filepath=pkg%2Fapi%2Ftransform_filter.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#diff-cGtnL2FwaS90cmFuc2Zvcm1fZmlsdGVyLmdv) | `46.15% <46.15%> (ø)` | |
jotak commented 3 months ago

This has no impact on netobserv operator currently, hence marking no-qe

jotak commented 3 months ago

/approve

openshift-ci[bot] commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jotak

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/netobserv/flowlogs-pipeline/blob/main/OWNERS)~~ [jotak] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
jotak commented 3 months ago

/test unit