envoy icon indicating copy to clipboard operation
envoy copied to clipboard

make the response code details append-able

Open wbpcode opened this issue 1 year ago • 4 comments
trafficstars

Title: make the response code details append-able

There always has the requirement to record envoy's internal events and log them. By this way, we can understand the processing of envoy more clearly, and this way could help developers/users to know what was exactly happened if envoy doesn't works as expected.

There are some possible ways to achieve this target:

  1. filter state, this is great and extendable. But also is heavy if we just want to record some short event strings.
  2. custom response flags, also great but we may don't want to register one custom flag for every un-common event.
  3. response code details, only latest value will be kept.

The response code details provide an easy way to record the inner event strings and to log them. (The response flags and response code details are two super great features to help debugging envoy.)

But now, every setResponseCodeDetails call will override the old value. It make it's hard to record multiple events. For example, auth request is failed because no healthy upstream and then the filter send a local reply. There are two important points: why auth request is failed, and who and why send the local reply. If we want to record the both points, then we need to join these event string carefully. For another example, the auth request is failed but the filter still want to send the original request to upstream. Then the finally via_upstream (set by router) will override all old values.

This, may be we can make the response code detail be append-able. Then we can record multiple events at same time in a single response code details string.

wbpcode avatar Mar 12 '24 04:03 wbpcode

cc @ggreenway

wbpcode avatar Mar 12 '24 04:03 wbpcode

May related to https://github.com/envoyproxy/envoy/issues/32250

wbpcode avatar Mar 12 '24 04:03 wbpcode

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 Apr 11 '24 20:04 github-actions[bot]

/assign

vikaschoudhary16 avatar May 13 '24 03:05 vikaschoudhary16