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

Added flowLabel, includeLabelInRouter flow fields + relabel output #1294

Conversation

gvizdpeter
Copy link
Contributor

@gvizdpeter gvizdpeter commented Apr 9, 2023

Fixes #1115

@gvizdpeter gvizdpeter force-pushed the feature/added-flow-label-and-exlcude-label-from-router-field branch from 5a98817 to 6bc017a Compare April 9, 2023 10:06
@gvizdpeter gvizdpeter force-pushed the feature/added-flow-label-and-exlcude-label-from-router-field branch from 585d409 to e2f0907 Compare April 9, 2023 11:46
pkg/sdk/logging/model/output/relabel.go Outdated Show resolved Hide resolved
pkg/sdk/logging/model/types/builder.go Outdated Show resolved Hide resolved
petergvizd and others added 11 commits April 14, 2023 10:59
Signed-off-by: Peter Wilcsinszky <[email protected]>
Signed-off-by: Peter Gvizd <[email protected]>
Signed-off-by: Peter Wilcsinszky <[email protected]>
Signed-off-by: Peter Gvizd <[email protected]>
Signed-off-by: Peter Wilcsinszky <[email protected]>
Signed-off-by: Peter Gvizd <[email protected]>
Signed-off-by: Peter Wilcsinszky <[email protected]>
Signed-off-by: Peter Gvizd <[email protected]>
Signed-off-by: Peter Wilcsinszky <[email protected]>
Signed-off-by: Peter Gvizd <[email protected]>
Signed-off-by: Peter Wilcsinszky <[email protected]>
Signed-off-by: Peter Gvizd <[email protected]>
Co-authored-by: Peter Wilcsinszky <[email protected]>
Signed-off-by: Peter Gvizd <[email protected]>
@gvizdpeter gvizdpeter force-pushed the feature/added-flow-label-and-exlcude-label-from-router-field branch from 62edf18 to 1d74ed8 Compare April 14, 2023 08:59
@gvizdpeter gvizdpeter changed the title Added flowLabel, excludeLabelFromRouter flow fields + relabel output Added flowLabel, includeLabelInRouter flow fields + relabel output Apr 14, 2023
@gvizdpeter
Copy link
Contributor Author

gvizdpeter commented Apr 15, 2023

@pepov This is probably logic, that you requested 82747df ,
if FlowLabel is empty, automatically include flow in router unless explicitly defined to exclude
if FlowLabel is not empty, automatically exclude flow from router unless explicitly defined to include
Unfortunately this logic can not be in builder.go, as there is flow label already calculated.

Or do you want to completely remove includeLabelInRouter param from user control, and drive it only by existence of FlowLabel?

@gvizdpeter gvizdpeter force-pushed the feature/added-flow-label-and-exlcude-label-from-router-field branch from d6adc62 to 82747df Compare April 15, 2023 10:26
Copy link
Member

@pepov pepov left a comment

Choose a reason for hiding this comment

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

With some minor fixes, this is exactly what I was asking for, thank you!

pkg/sdk/logging/model/render/fluent_test.go Outdated Show resolved Hide resolved
pkg/sdk/logging/model/render/fluent_test.go Outdated Show resolved Hide resolved
pkg/sdk/logging/model/render/fluent_test.go Outdated Show resolved Hide resolved
pkg/sdk/logging/model/render/fluent_test.go Outdated Show resolved Hide resolved
pkg/sdk/logging/model/render/fluent_test.go Outdated Show resolved Hide resolved
pkg/sdk/logging/model/render/test_helper.go Outdated Show resolved Hide resolved
pkg/sdk/logging/model/types/flow.go Outdated Show resolved Hide resolved
pkg/sdk/logging/model/types/builder.go Outdated Show resolved Hide resolved
pkg/sdk/logging/model/types/flow.go Outdated Show resolved Hide resolved
pkg/sdk/logging/model/types/flow.go Outdated Show resolved Hide resolved
@gvizdpeter
Copy link
Contributor Author

Thank you as well, hope it is OK now

@tarokkk tarokkk self-requested a review April 19, 2023 19:27
@pepov
Copy link
Member

pepov commented Apr 20, 2023

@gvizdpeter thanks for the nice contribution, merging this now!

@pepov pepov merged commit 0fa1657 into kube-logging:master Apr 20, 2023
@pepov
Copy link
Member

pepov commented Apr 20, 2023

Created a follow up issue for the docs: kube-logging/kube-logging.github.io#131

@gvizdpeter could you please help with the documentation part? No need to figure out the right place or the proper wording, just creating a sketch with a general description and the most important use-cases.

@gvizdpeter
Copy link
Contributor Author

Hello @pepov I will try to add something to opened issues.

@Jorricks
Copy link

Jorricks commented Apr 30, 2024

Does someone happen to have a nice example of this with the concat plugin using timeout_label and then the relabel in action?

@pepov
Copy link
Member

pepov commented May 3, 2024

If concat produces messages with new labels, then you don't need relabel, just a flow with the label you want to redirect timeouted messages:

apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:
  name: concat-timeout-flow
spec:
  flowLabel: '@concat-timeout'
  includeLabelInRouter: false
  localOuputs: ...

Maybe the question is what do you want to do with those messages ran into timeout?

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.

Concat plugin no possibility to use timeout_label
5 participants