allegro / envoy-control

Envoy Control is a platform-agnostic, production-ready Control Plane for Service Mesh based on Envoy Proxy.
Apache License 2.0
100 stars 33 forks source link

Add upstream service tag response header; reject requests with service-tag duplicates #366

Closed MarcinFalkowski closed 1 year ago

MarcinFalkowski commented 1 year ago

Two supporting features related to routingPolicy.autoServiceTag:

  1. Reject requests with a service-tag which duplicates one of the tags in routingPolicy.serviceTagPreference list. It's important to reject such requests, because during migration from manual service tags to auto service tags it's very easy to forget to remove manual tags. Right away it will work correctly, but later, when service-tag-preference will change, the application will stop working correctly. It's better to detect such problems immediately.
  2. Return selected upstream service instance service-tags to the local service in response header x-upstream-service-tags (just like its IP in x-envoy-upstream-remote-address). When routing policy selects service instance automatically, the local service needs information which instance was selected for given request - for debugging and logging purposes.
    • It's enabled by default only for requests where automatic service-tag routing was used. Services can also enable or disable this feature for all requests by providing envoy metadata flag add_upstream_service_tags (true/false)