-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(exclusive_route transform): implements new transform #21707
base: master
Are you sure you want to change the base?
Conversation
TODO: add CUE doc. Opening it up for comments. |
Datadog ReportBranch report: ✅ 0 Failed, 7 Passed, 0 Skipped, 25.46s Total Time |
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.
Nice! I left a few comments below, but otherwise this looks good to me. I considered some other possible names for this transform (branch
, switch
, split
, etc.) but I think the exclusive_route
name makes its relationship to route
clear.
@@ -0,0 +1,29 @@ | |||
package metadata |
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.
Note that, in addition to the cue doc you mentioned is still TODO, you'll need to create a markdown file for the transform too.
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.
create a markdown file for the transform too.
Updated the PR with a lot of doc related changes. Not sure about this comment. Let me know if I missed something 🙏
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 you are still missing the markdown file so the new transform docs won't be rendered on the website. You'll need to create website/content/en/docs/reference/configuration/transforms/exclusive_route.md
. Hugo uses that to generate the transform page (theoretically these pages could be generated from the cue docs, I think, but they currently aren't).
@@ -180,6 +180,7 @@ jobs: | |||
reduce transform | |||
remap transform | |||
route transform | |||
exclusive_route transform |
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.
👍 appreciate you adding this at the same time.
@@ -0,0 +1,3 @@ | |||
Introduce a new exclusive_route transform, which functions as a switch statement to route events based on user-defined conditions. |
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 you mentioned you'd be writing a blog post on this one. I think a release highlight might be appropriate too (or instead of the blog): https://vector.dev/highlights/.
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.
Thanks for the updates!
It looks like website/cue/reference/components/transforms/exclusive_route.cue
is empty 🤔
|
||
if !duplicates.is_empty() { | ||
errors.push(format!( | ||
"Found routes with duplicate names: {:?}", |
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.
👍
ACK, I will add it soon. |
have you thought about adding a |
We did consider that, but the existing |
Well said, added this to the PR summary 👍 |
Summary
Introduces the new exclusive route transform. This is transform is very similar to the
route
transform but it acts like switch statement for routes (vs matching more than one route).We did consider adding extra options to the existing
route
transform, but the route transform has an unordered list of routes and so we'd need to further complicate the UX of that transform by either adding a weight parameter to each route to order them (opening a question of what to do if the weights are the same for two routes) or by migrating the route configuration from a map to a list (while ideally maintaining backwards compatibility).Change Type
Is this a breaking change?
How did you test this PR?
Does this PR include user facing changes?
Checklist
References
route
transform #9100