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

enable individual labels from aggregate #269

Merged
merged 2 commits into from
Aug 1, 2022

Conversation

KalmanMeth
Copy link
Collaborator

@KalmanMeth KalmanMeth linked an issue Jul 28, 2022 that may be closed by this pull request
Copy link
Member

@jotak jotak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Maybe we can think about a follow-up, because it creates redundant information in metrics (there are individual labels AND concatenated labels) => maybe a bool flag, or an enum in Aggregation api to let the user choose how they want the result to look like? E.g. labelsMode: enum(copy|concat)

Comment on lines 99 to 101
err, _, _ := aggregate.FilterEntry(entry)

require.Equal(t, err, nil)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a few more checks to test the new behavior.
Something like:

	err, normalizedLabels, labels := aggregate.FilterEntry(entry)
	require.Equal(t, err, nil)
	require.Equal(t, Labels{"srcIP": "10.0.0.1", "dstIP": "20.0.0.2"}, labels)
	require.Equal(t, NormalizedValues("20.0.0.2,10.0.0.1"), normalizedLabels)

@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2022

Codecov Report

Merging #269 (2b75e4c) into main (94fcbbf) will increase coverage by 6.18%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #269      +/-   ##
==========================================
+ Coverage   60.70%   66.88%   +6.18%     
==========================================
  Files          73       73              
  Lines        4247     4149      -98     
==========================================
+ Hits         2578     2775     +197     
+ Misses       1502     1194     -308     
- Partials      167      180      +13     
Flag Coverage Δ
unittests 66.88% <100.00%> (+6.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/pipeline/extract/aggregate/aggregate.go 96.90% <100.00%> (+0.08%) ⬆️
pkg/config/pipeline_builder.go 87.27% <0.00%> (-8.19%) ⬇️
pkg/confgen/config.go 33.33% <0.00%> (ø)
cmd/confgenerator/main.go 0.00% <0.00%> (ø)
cmd/flowlogs-pipeline/main.go 0.00% <0.00%> (ø)
pkg/pipeline/utils/params_parse.go
pkg/config/stage_params.go 100.00% <0.00%> (ø)
pkg/pipeline/ingest/ingest_collector.go 49.62% <0.00%> (+1.50%) ⬆️
pkg/test/utils.go 64.70% <0.00%> (+1.74%) ⬆️
pkg/pipeline/write/write_loki.go 67.77% <0.00%> (+2.94%) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94fcbbf...2b75e4c. Read the comment docs.

@KalmanMeth KalmanMeth merged commit 6c1dae1 into netobserv:main Aug 1, 2022
@KalmanMeth KalmanMeth deleted the labels-for-aggregate branch January 29, 2023 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make FLP able to generate labels per aggregate
4 participants