-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(http sink): templateable uri #23288
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: master
Are you sure you want to change the base?
feat(http sink): templateable uri #23288
Conversation
src/sinks/http/tests.rs
Outdated
|
||
tokio::spawn(server); | ||
|
||
sink.run_events([event]).await.unwrap(); |
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.
Couldn't use run_and_assert_sink_error
because there were 2 errors being emitted (ServiceCallError
and SinkRequestBuildError
), and this assert failed https://github.com/vectordotdev/vector/blob/master/lib/vector-common/src/event_test_util.rs#L31 because the assert just checks that there is just one event name that contains the word "Error"
vector/src/test_util/components.rs
Line 91 in 3b583b1
events: &["Error"], |
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 nice to refactor it so we can re-use it 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.
Refactored in 83d8fa6, let me know what you think
74e60b5
to
9c7993b
Compare
Hi @jorgehermo9, thank you for this PR! I will review it today. Please add a PR description a Vector config you used to test this. |
src/sinks/http/tests.rs
Outdated
|
||
tokio::spawn(server); | ||
|
||
sink.run_events([event]).await.unwrap(); |
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 nice to refactor it so we can re-use it here
Hi @pront, thank you very much for your prompt review! I had no time today, but will address everything tomorrow; split the ConcurrementMap fix in another PR, open the two issues I mentioned, specifying a config to test this in the PR description... Than ks! |
Updated the PR's description with a test config & steps! |
Still have a few comments left, I'll address them through the week, I had busy days lately, sorry! I'll ping when everything is done :) |
👍 thanks! |
1720078
to
ffe54be
Compare
Hi @pront, About the I was mistaken and the event was being notified with Line 260 in 618a8e8
And about the I think the only one thing left is the Sorry for the delay! |
Closes #1155
Testing
First, spin up a dummy http server that will receive the requests of the http sink, for example, using
dummyhttp
Then, using the following Vector config:
We listen for incoming requests at 8080 and then forward them to
localhost:8081
taking theid
field of the events to render the uri.Then, we send requests with a payload that contains that
id
field to the http source:curl -X POST -d '{"id":5,"message":"test2"}' localhost:8080
and we can see requests reaching the

dummyhttp
server with the path/id/5
If we send multiple


curl
commands within the same batch time window (5s) we can see the events grouped in the same request (for example, sending 3 events with id=5 and 2 events with id=3)