Closed pdomagala closed 4 years ago
@pdomagala , I will get this code in for next release. Thank you for opening the issue with the conversation from Slack. As of right now, it sounds like it would be best if it is a global switch and then a switch for each app to enable and disable the header.
The global switch will enable for all apps and be the easiest option for the users to enable this optional header.
The global switch will enable it for all apps by default underneath the hephy-router. If a user wants to disable it for certain apps that are using another loadbalancer, then the user can opt-in to add an annotation to the application service and disable them for each specific app that does not need the header underneath the hephy-router. It requires more configuration per app but this is a very custom setup so the extra configuration is warranted.
I am thinking for the names of the annotations to be:
Component | Resource Type | Annotation | Default Value |
---|---|---|---|
deis-router | deployment | router.deis.io/nginx.requestStartHeader | false |
routable application | service | router.deis.io/disableRequestStartHeader | N/A* |
false
if router.deis.io/nginx.requestStartHeader is true
, but can be overwritten to false
for all apps.How does that sounds @felixbuenemann and @pdomagala ?
Will the X-Request-Start
header be ever set to anything different from t=${msec}
?
Sounds great to me! t=${msec}
is perfect, NewRelic recommends the same value in their docs.
Thanks for fast response 👍
I would simplify the name to requestStart
or requestStartHeader
if the shorter version seems confusing, because the option that toggles X-Request-ID
headers is simply called requestIDs
.
Per the discussion above I have made the annotations simpler:
router.deis.io/nginx.requestStartHeader
router.deis.io/disableRequestStartHeader
First one is set on global hephy-router annotations, the other is the application annotation to opt-out of the X-Request-Start header for each application if necessary.
Looks like we will be modifying the PR a bit:
So if appConfig.RequestStartHeader is nil, we use the value from routerConfig.RequestStartHeader, but if it is either true or false it overrides the routerConfig value. - @felixbuenemann
This can be tested with container cryptophobia/router:git-6016a3d
.
It would be great if we can enable/disable
x-request-start
header on specific app.below discussion from slack: