-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Support AWS Kinesis destination #316
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I don't think this should be exposed to the end-user. I think it's operator-only config as the operator should determine what's in the event payload and not the end-user.
Show it for now.
I don't quite understand this. But I'm assuming my comment on 1. would have an impact. May be something worth discussing live and then capturing the outcome in GitHub.
Gotcha. End logic may be impacted by 1. and 3. |
This implements the RFC from #305. A few note-worthy things to call out here:
1. Add
config.metadata_in_payload
bool config as suggested in the issue.2.
config.endpoint
UIThis should probably be hidden. However, it would make local dev testing difficult, especially when using the UI to test locally. With SQS, we can derive the endpoint from the
queue_url
field and detect whether it's production AWS or local LocalStack. We can't do the same with AWS Kinesis.Options:
3. Partition key template payload
This PR implements the partition templating with JMESPath as discussed in the RFC.
One thing to note is that I ended up going with the message payload as the input for the template. What I mean is that when producing a Kinesis record, we need 3 info:
stream_name
,partition_key
, anddata
(bytes version of a Go map); whatever the data content is, that map is the payload for the partition key template.For example, with an event like so:
If
metadataInPayload: true
, the resulting payload would be:So, you can do something like
metadata.mymeta
ormetadata.topic
as the partition key tempalte.If
metadataInPayload: false
, the resulting payload would beIn that case, you can do
mydata
for the template. Or an empty string, in which case we'll use the event ID as the partition key. One note is that you will NOT be able to use topic as the partition key in this case, unless topic is part of the data itself.Reasoning
The reason I went with this approach was around the end-user perspective. They won't know what an event is, and the only thing they know is the payload they'll receive. Therefore, I think this makes a bit more sense than the incoming event payload from the producer/operator side.
However, this still requires the user to know beforehand what the expected data shape is. It's a bit more complicated than webhook, for example, where you can just provide a URL and observe the incoming requests. Maybe it's a necessary consideration, given the technology.
4. Delivery details
This is how the UI looks right now.
NOTE: The "message" UI is incorrect now. Currently, the message UI is fake, deriving from the event. For Kinesis, it doesn't account for the fact that the user can opt-out of metadata, and therefore the message can be different. We probably need to add a task to persist message data & display properly.
Dev notes:
go run ./cmd/destinations/awskinesis
. Make sure you runmake up/deps
beforehand. There're new changes to the Docker Compose, so if you had it running previously, also make sure to restart the containers.TODO:
Next step:
PutRecords
to send events in batch