tikv / pd

Placement driver for TiKV
Apache License 2.0
1.05k stars 719 forks source link

Add middleware to PD microservice #8548

Open HuSharp opened 2 months ago

HuSharp commented 2 months ago

Enhancement Task

Currently, the API for microservice nodes(TSO/Scheduling) is implemented by the redirector and does not take into account the middleware of the API itself, such as audit logs.

redirector

https://github.com/tikv/pd/blob/f3602e31640a55b61a3b14fb3989c4a0742a2416/server/api/server.go#L67-L93

PD-API Middlewares

https://github.com/tikv/pd/blob/a7663514c5ebfc78a99bacc84e030c9b7530a10b/server/api/middleware.go#L37-L43

ref

https://github.com/tikv/pd/issues/5766 https://github.com/tikv/pd/issues/7178 https://github.com/tikv/pd/pull/7078

lhy1024 commented 2 months ago

Do we need to add them? cc @niubell @rleungx