solo-io / gloo

The Feature-rich, Kubernetes-native, Next-Generation API Gateway Built on Envoy
https://docs.solo.io/
Apache License 2.0
4.07k stars 434 forks source link

Expose duration and latency metrics as response headers #7879

Open bdecoste opened 1 year ago

bdecoste commented 1 year ago

Version

None

Is your feature request related to a problem? Please describe.

I would like to be able to add request, response, and upstream latency/duration to response headers. Specifically:

From the latency filter:

%DYNAMIC_METADATA(io.solo.filters.http.proxy_latency:request_out)%
%DYNAMIC_METADATA(io.solo.filters.http.proxy_latency:request_out_internal)%
%DYNAMIC_METADATA(io.solo.filters.http.proxy_latency:request_out_internal)%

From the access log operators:

%DURATION%
%REQUEST_DURATION%
%RESPONSE_DURATION%

Have tested using clusterMetadata in an Inja transform but this does not expose the required data

Describe the solution you'd like

Be able to configure response headers to include the metrics above, probably via a response transformation

Describe alternatives you've considered

None

Additional Context

No response

bdecoste commented 1 year ago

Mean to open in gloo-mesh-enterprise

github-actions[bot] commented 2 months ago

This issue has been marked as stale because of no activity in the last 180 days. It will be closed in the next 180 days unless it is tagged "no stalebot" or other activity occurs.