Add ability to suppress Linkerd error response body and header
- Dominant language
- Scala
- Stars
- 5.3k
- Forks
- 494
- PR merge metrics
- No merged PRs in 30d
Description
Issue Type:
- [ ] Bug report
- [X] Feature request
# Problem
We are trying to use Linkerd's dtab feature to build very large, dynamic routing tables. The goal to use Linkerd (instead of, e.g. Consul) to control which versions of which applications get routed to when a a request for a particular service is received.
This requires us to dynamically build most of our dtab, and requires that the dtab have an explicit dentry for every service in our eco system. E.g.:
```
...
/svc/cool-thing => /tagged/ver-1.3/cool-thing;
/svc/lame-thing => 0.1 * /tagged/ver-2.0/lame-thing & 0.9 * /tagged/ver-1.8/lame-thing;
...
```
This means that our dtab will get *very* large! The example I'm working with at the moment is 1811 lines long, and 143kb.
When linkerd errors in some way (say when a requested service is not found), it currently 502s and sends back an error message that contains, among other things, the entire dtab in both the body and a response header.
Fortunately, Linkerd appears to truncate the response header field instead of blowing up. But I think it would be useful to be able to suppress this verbose response by default, exposing it only if the client provided a debug header.
# Possible solution
Provide a configuration option to suppress verbose error responses by default.
Add support for a debug header that results in the verbose error response.
Contributor guide
Research direction
Start by tracing Linkerd's error response handling and configuration entry points, then inspect how verbose error bodies and headers are currently produced. Done means a configuration option suppresses verbose responses by default while a client debug header restores them, with tests covering both behaviors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100