Injecting User Defined HTTP Response Headers

I have an API Gateway linkerd that routes both HTTP and gRPC over HTTP/2 requests to sidecar linkerd’s in front of my applications.

How could I determine from the HTTP response (from the API gateway), which server the application response was sent from?. I can’t change the application’s code.

Is there a way to add a user defined HTTP response header in the sidecar linkerd so that I can, for example, set the current server’s name/IP.

Short answer: no out of the box way to do this.

You would likely need to write a Linkerd plugin that sets a custom response header. Here’s an example of a Response Classifier plugin, which is related to what you need:

Linkerd does do a good job of forward request headers downstream. If your application (or modified Linkerd) could simply reflect those headers back into the Response, you’d have identifiable information in your Response Headers. Here’s another post dealing with Request Headers:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.