-
Notifications
You must be signed in to change notification settings - Fork 913
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
feat: asynchronous outputs and slow outputs detection #1451
Conversation
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
afcbd9d
to
0478ec9
Compare
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
Signed-off-by: Leonardo Grasso <[email protected]>
8dd92eb
to
97b7610
Compare
LGTM label has been added. Git tree hash: ac6f76b0f8c7db45259b70b4dddcf70c056bf372
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fntlnz, leodido 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:
Approvers can indicate their approval by writing |
Since the release of Falco 0.27 has been postponed I let this go in! 🥳 /hold cancel |
/milestone 0.27.0 |
See falcosecurity/falco#1451 Signed-off-by: Leonardo Grasso <[email protected]>
See falcosecurity/falco#1451 Signed-off-by: Leonardo Grasso <[email protected]>
See falcosecurity/falco#1451 Signed-off-by: Leonardo Grasso <[email protected]>
See falcosecurity/falco#1451 Signed-off-by: Leonardo Grasso <[email protected]>
Modify falco_formats to only be responsible for resolving a rule's output string or coming up with a map of field name->field values from a given output string. It relies on the changes in falcosecurity/libs#77 to use generic formatters for a given source. Remove lua bindings to create a formatter/free a formatter. Those were unused as of the changes in #1451, so finally remove them now. Signed-off-by: Mark Stemm <[email protected]>
Modify falco_formats to only be responsible for resolving a rule's output string or coming up with a map of field name->field values from a given output string. It relies on the changes in falcosecurity/libs#77 to use generic formatters for a given source. Remove lua bindings to create a formatter/free a formatter. Those were unused as of the changes in #1451, so finally remove them now. Signed-off-by: Mark Stemm <[email protected]>
Modify falco_formats to only be responsible for resolving a rule's output string or coming up with a map of field name->field values from a given output string. It relies on the changes in falcosecurity/libs#77 to use generic formatters for a given source. Remove lua bindings to create a formatter/free a formatter. Those were unused as of the changes in #1451, so finally remove them now. Signed-off-by: Mark Stemm <[email protected]>
Modify falco_formats to only be responsible for resolving a rule's output string or coming up with a map of field name->field values from a given output string. It relies on the changes in falcosecurity/libs#77 to use generic formatters for a given source. Remove lua bindings to create a formatter/free a formatter. Those were unused as of the changes in #1451, so finally remove them now. Signed-off-by: Mark Stemm <[email protected]>
Modify falco_formats to only be responsible for resolving a rule's output string or coming up with a map of field name->field values from a given output string. It relies on the changes in falcosecurity/libs#77 to use generic formatters for a given source. Remove lua bindings to create a formatter/free a formatter. Those were unused as of the changes in #1451, so finally remove them now. Signed-off-by: Mark Stemm <[email protected]>
Modify falco_formats to only be responsible for resolving a rule's output string or coming up with a map of field name->field values from a given output string. It relies on the changes in falcosecurity/libs#77 to use generic formatters for a given source. Remove lua bindings to create a formatter/free a formatter. Those were unused as of the changes in #1451, so finally remove them now. Signed-off-by: Mark Stemm <[email protected]>
Modify falco_formats to only be responsible for resolving a rule's output string or coming up with a map of field name->field values from a given output string. It relies on the changes in falcosecurity/libs#77 to use generic formatters for a given source. Remove lua bindings to create a formatter/free a formatter. Those were unused as of the changes in #1451, so finally remove them now. Signed-off-by: Mark Stemm <[email protected]>
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
This PR aims to introduce a non-blocking Falco's outputs processing, as per #1417. In details:
output_event()
andoutput_msg()
);Incoming messages are being formatted in the main thread, then send to the worker thru the queue. Finally, the worker receives the formatted messages, then fanouts them to the enabled outputs.
Since the new implementation forwards both the usual messages (i.e., those that happen when a rule is matched) and other kinds of messages (i.e., drop alerts) to the same method (
falco::outputs::abstract_output::output(const message *msg)
), now the gRPC output inherits the ability to subscribe to dropped events.Finally, d6f2a3a and 4e520fa introduced a watchdog for slow output channels. Basically, when the consumer blocks an output channel for a while, an error is logged (that signals a misconfiguration or a problem that the user should fix).
Which issue(s) this PR fixes:
Fixes #531
Fixes #1417
Fixes #884 (drop alerts for gRPC)
Also, reduce the likelihood of dropped events, see #1403.
Special notes for your reviewer:
There is no guard to avoid that the message queue grows indefinitely. However, the message queue growth is limited by the embedded notification rate limiter. There is also no guard for the gRPC queue, but it's a different issue (in this case depends on the ability/presence of a client to consume notifications). It's not a goal of this PR solving these issues.
I'm assuming 2 seconds is a sane default to detect slow output channel consumers. You can simulate a slow output by configuring the
program_output
as following:AFAIK one blocker for adding drop alerts was the decision about using the existing API or a newer one (see gRPC outputs: stream drop alerts #884).
Since even with drop alert we will not have any empty field, I believe it's acceptable to re-use the same proto also in case of a drop alert message.
However, I have added a new source:
internal
. It's needed because Falco internal messages (e.g., drop alerts) did not have their own source, and the proto requires that (we cannot just leave it empty).Below an example of how a drop alert will look like to a gRPC client:
Does this PR introduce a user-facing change?: