envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Support outbound call within Envoy's cluster from Golang filter

Open ardikabs opened this issue 1 year ago • 7 comments

Title: Support outbound call within Envoy's cluster from Golang filter

Description: Currently, when there is a need to make outbound calls within Golang filter, the filter will handle by itself which is unfortunate that the current implementation cannot utilize Envoy's full capabilities, such as circuit-breaking, retry mechanisms, locality-aware routing, and other advanced features.

In comparison to the Lua filter, which has been supported through httpcall.

[optional Relevant Links:]

Any extra documentation required to understand the issue.

ardikabs avatar Jul 16 '24 07:07 ardikabs

cc @doujiang24

KBaichoo avatar Jul 16 '24 13:07 KBaichoo

Thanks, the API does make sense. But not a high priority for me now, patches/volunteers are welcome~

doujiang24 avatar Jul 18 '24 02:07 doujiang24

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 17 '24 04:08 github-actions[bot]

@wbpcode please add no-stale, thanks

doujiang24 avatar Aug 18 '24 03:08 doujiang24

Hi @doujiang24,

I’m curious about what it would take to implement this. Which Envoy API call needs to be wrapped? Is there a similar example we could reference? Thanks.

chenwan0036 avatar Aug 23 '24 15:08 chenwan0036

Hi @chenwan0036

There isn't a simple Envoy API to be wrapped, here are the key points:

  1. we have to implement Envoy C++ API, similar to Lua: https://github.com/envoyproxy/envoy/blob/main/source/extensions/filters/http/lua/lua_filter.cc#L156-L187
  2. after Golang invoke the Envoy C++ API, Golang should yield and wait Envoy call Golang to resume, i.e. https://github.com/envoyproxy/envoy/blob/main/contrib/golang/filters/http/source/golang_filter.cc#L1037

doujiang24 avatar Aug 26 '24 03:08 doujiang24

@doujiang24, thank you for your response. I’ve realized it’s more complex than I initially thought. I tried implementing an HTTP call (key point 1), but it was tougher than I expected, and I didn’t make much progress. This experience gave me a new appreciation for filter development and your work—it's truly impressive.

chenwan0036 avatar Aug 27 '24 21:08 chenwan0036