-
Notifications
You must be signed in to change notification settings - Fork 34
NETOBSERV-258: add TimeReceived in Kafka transformer #235
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be we should add a check to ensure there is no TimeReceived field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, if there is no
TimeReceivedfield, it will be added to the current payload. If there is an actualTimeReceivedfield, it will be added after this, overriding the value that we set here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it what we want? To override TimeReceived if the field is already here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's ok as a quick fix, but we can think about it and iterate from there.
Maybe it would make more sense to have it in the ingester stage rather than in the json decoder ? it looks more like an ingester responsibility to tell when something is received.
And I agree with Olivier that, if the field is already present, it shouldn't be overwritten. E.g. if we have:
(ovs) -> ipfix-ingester -> kafka-write -> kafka-read -> lokithe received time should be the one of ipfix-ingester .. or maybe at the opposite, on loki side?
As we use it to measure the collection latency (by comparing to FlowEndTime), maybe it makes actually more sense to deal with it directly in the loki write, after all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I explained it wrong. The timereceived field is never overridden if its already there (please check the tests)
@jotak currently we set the value into the ipfix or protobuf ingesters but we added a new scenario: the eBPF agent can send it directly to the flowlogs-pipeline-transformer instance directly as a JSON via kafka.
In that case, we are bridging the ingesters and the receive time needs to be set in the transformer instance.
But if we agree that the actual ingest time should be now right before Loki writing, this could be removed and we wouldn't need to consider this special case.