reddit / baseplate.go

Reddit's Service Framework in Go
https://pkg.go.dev/github.com/reddit/baseplate.go
BSD 3-Clause "New" or "Revised" License
90 stars 76 forks source link

[RFC][Snoosweek] Support for DTab overrides #626

Closed folone closed 1 year ago

folone commented 1 year ago

📚 Background reading

💸 TL;DR

This PR demonstrates a simple support for system-wide request-level target override for services. I've tried my best to demonstrate how it would work in the following diagram: Diagram

📜 Details

This is a demonstration PR, intended to elicit comments/opinions, not intended for merging as is.

This change does not exactly implement DTabs as described in the docs above – those require some internal knowledge of service/name resolver on behalf of the client constructor. Rather, this change is inspired by those documents. Which means the name "DTab" might not actually be very relevant here. Should this be called something like "ServiceAddressOverrides" instead?

💡 The general idea is as follows:

🧑‍🔬 User stories

🔨 Improvements that can/should be made here

✅ Checks

folone commented 1 year ago

@kylelemons @konradreiche @pacejackson Thanks for the feedback folks! Looks like there might be some tentative interest in something like this. As Kyle suggested, I'll write up a design doc and try to get a slot in your office hours to discuss how feasible this is within Reddit.

fishy commented 1 year ago

@folone This part won't really work in Reddit's environment:

But I'd prefer that the engineer could stage just the services they are changing, and give me some headers I could plug into ModHeader, so I could use the actual product we're developing in its production environment (except for that one service)

Because it essentially requires traffic between production and staging clusters, which is not allowed.

Basically at Reddit stagings can only talk to stagings and productions can only talk to productions.