Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Implement validation for incoming events #79

Closed
Tracked by #34 ...
rdner opened this issue Jul 14, 2022 · 1 comment · Fixed by #90
Closed
Tracked by #34 ...

Implement validation for incoming events #79

rdner opened this issue Jul 14, 2022 · 1 comment · Fixed by #90
Assignees
Labels
Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Comments

@rdner
Copy link
Member

rdner commented Jul 14, 2022

We should not pass an event if it has no Source, Timestamp or DataStream fields.

@rdner
Copy link
Member Author

rdner commented Aug 11, 2022

After a meeting, @cmacknz @faec and I decided on the following steps:

  • We add a special Strict Mode configuration parameter for the gRPC server configuration
  • If the Strict Mode is active, we inspect the whole event batch before trying to publish any of the events to the queue. We validate against missing required fields in each event.
  • When we find an invalid event, we immediately return a codes.InvalidArgument gRPC error with a detailed error message that describes invalid fields of the event letting know the client as a failure
  • When we're not in the Strict Mode there is no validation whatsoever, all the invalid events are accepted and propagated through the queue

The intention here is to have a "fail fast" approach for the input developers while debugging and to avoid additional validation overhead in production.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants