-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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(events): Add internal event id to event metadata #21074
Conversation
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.
Overall this looks good and simple 👍 I would like to get at least one more review/stamp on this before merging.
Another good test to have, is to generate an event at source, pass it through a transform and observe that the generated ID was preserved.
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 would be interesting to see examples of how this could be used, and I agree with the recommendation to consider V7 UUIDs, but otherwise this makes sense to me.
Datadog ReportBranch report: ✅ 0 Failed, 7 Passed, 0 Skipped, 25.56s Total Time |
Some test fail due to the fact that EventMetadata::Default() is now not deterministic (as uuid are random). Don't know what to do to fix that without involving much changes 🤔 Maybe a manual impl of |
@jorgehermo9 ended up using the derivative crate to ignore PartialEq (saw this crate is used in other parts of the vector codebase, but lmk if you think there might be any issues introduced by this) |
yep, thats sounds like what I would do, lgtm |
Small nit: we generally like to discourage force-pushes to Vector PRs once reviews have started as it makes the PR history more difficult to understand. Instead of rebasing you can merge in I'm realizing this isn't mentioned in https://github.com/vectordotdev/vector/blob/master/CONTRIBUTING.md. I'll add a note there. |
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.
The existing code LGTM. This will need to have the new pre-v41
added to the test suite in lib/codecs/tests/native.rs
however.
lib/codecs/tests/native.rs
Outdated
#[test] | ||
fn pre_v41_fixtures_match() { | ||
fixtures_match("pre-v41"); | ||
} |
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 think we also need tests of roundtrip_fixtures
and decoding_matches
.
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 looks like the decoding_matches
tests are broken due to #18570. Will add the ignore
flag for the pre-v41
test as well unless there is an existing fix
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.
/ci-run-regression
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.
/ci-run-regression
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.
/ci-run-regression
…1074) * add internal event id to event metadata * fix formatting * formatting * rename source_event_id + use uuid v7 + add uuid as workspace dependency * cargo fmt * use derivative crate to ignore source_event_id field for PartialEq * rebase + merge * fix Cargo.toml file * add protobuf parsing for event id field * generate new test fixtures * Update Cargo.lock * add pre-v41 to native.rs test-suit + fix import re-ordering * add pre-v41 tests for roundtrip_fixtures & decoding_matches
Overview
Adds an internal event id to all events that pass through Vector. This internal id will be a UUID generated on event creation, and can be used to uniquely identify an event as it traverses through different components in a pipeline.
Testing
Added unit test
Tested using
demo_logs
source type