vector icon indicating copy to clipboard operation
vector copied to clipboard

Make the `http` sink `uri` option templateable

Open binarylogic opened this issue 6 years ago • 16 comments

Currently, the http sink's uri option is static. It would be nice to make it templateable, allowing users to partition data across different uris. Ex:

[sinks.my_http_sink]
  type = "http"
  uri = 'https://localhost/{{application_id}}

binarylogic avatar Nov 06 '19 15:11 binarylogic

@LucioFranco assigning this to you since this should be much easier now, correct? It has a decently high user value. If this is a big change please unassign yourself and we can talk about it more.

binarylogic avatar Apr 08 '20 00:04 binarylogic

This would require some changes to our httpsink trait and update our http sink to be partition able. So I think this may be a bit harder than simply adding a templatable uri.

LucioFranco avatar Apr 13 '20 17:04 LucioFranco

@bruceg is this doable? And is it somewhat related to your batching work?

binarylogic avatar Jun 20 '20 16:06 binarylogic

@LucioFranco is right that this is more difficult than just adding templating to the URI, since it means collecting multiple batches simultaneously. I think we already have the infrastructure to do this, but that doesn't mean it will necessarily be a simple change. It does touch on batching behavior, but should be mostly independent of the batching rework.

bruceg avatar Jun 22 '20 14:06 bruceg

Noting, we'd like to make more progress on our architectural changes before approaching this.

binarylogic avatar Jul 06 '20 14:07 binarylogic

Having this feature would help vector to write nicely into fluentd which currently has the message tag as part of the url path: https://docs.fluentd.org/input/http

apollo13 avatar Aug 16 '21 14:08 apollo13

Having this feature would help vector to write nicely into fluentd which currently has the message tag as part of the url path: https://docs.fluentd.org/input/http

As an aside, I suspect we will be adding a dedicated sink for fluent, now that we have the source in place - but I'm not sure on the timeline for that

spencergilbert avatar Aug 16 '21 15:08 spencergilbert

That sounds great as well, but in the interim the HTTP transport works well enough :) I'd also question if it is worth to add a fluentd "forward" protocol sink when HTTP works just as well (aside from the tag thingy in the URL)? While I appreciate adding support for more protocols I think that if the other side speaks HTTP well enough, why not just advertise that instead. Granted the forward protocol might exhibit some better behavior with ACKs and the likes, so it might still be worth to add.

apollo13 avatar Aug 16 '21 15:08 apollo13

That sounds great as well, but in the interim the HTTP transport works well enough :) I'd also question if it is worth to add a fluentd "forward" protocol sink when HTTP works just as well (aside from the tag thingy in the URL)? While I appreciate adding support for more protocols I think that if the other side speaks HTTP well enough, why not just advertise that instead. Granted the forward protocol might exhibit some better behavior with ACKs and the likes, so it might still be worth to add.

Definitely 🙂 there's also work being done around codecs and decoders, so the source/sink may be a layer of "generic http sink + known codec" and for ease of use the user just says "fluent" and we chain the necessary bits under the covers.

spencergilbert avatar Aug 16 '21 15:08 spencergilbert

Any update here? we'd like to use http-sink as our webhook out. To achieve this, we need the entire URL as a template, not just the path.

udleinati avatar Feb 09 '22 14:02 udleinati

Hey @udleinati ! Nothing yet. As always, we are open to PRs though :)

jszwedko avatar Feb 09 '22 16:02 jszwedko

Another 👍🏻 for this. I asked for this feature via discord, eventually pointed ehre :)

If only I knew rust.

https://discord.com/channels/742820443487993987/1126537900549492736/1126537900549492736

Mezzle avatar Jul 07 '23 07:07 Mezzle

Any update here?

autokilla47 avatar Sep 26 '23 10:09 autokilla47

Any update here?

obitoquilt avatar Dec 06 '23 02:12 obitoquilt

Not yet unfortunately, but happy to see a PR if someone is motivated 🙏

jszwedko avatar Dec 06 '23 14:12 jszwedko

Hi, I'm working on this and will try to submit a PR soon!

jorgehermo9 avatar Jun 10 '25 20:06 jorgehermo9

quick update: I've got it fully working in my local! Just tests & documentation remaining and will submit it by end of week

jorgehermo9 avatar Jun 16 '25 21:06 jorgehermo9

quick update: I've got it fully working in my local! Just tests & documentation remaining and will submit it by end of week

Thanks, looking forward to this contribution!

pront avatar Jun 17 '25 15:06 pront