cmd/tailscale: add event bus queue depth debugging

Under extremely high load it appears we may have some retention issues
as a result of queue depth build up, but there is currently no direct
way to observe this. The scenario does not trigger the slow subscriber
log message, and the event stream debugging endpoint produces a
saturating volume of information.

Updates tailscale/corp#36904

Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
James Tucker
2026-02-06 01:06:41 -08:00
parent 35e656a35f
commit fe69b7f0e5
3 changed files with 78 additions and 0 deletions
+15
View File
@@ -124,6 +124,12 @@ func debugCmd() *ffcli.Command {
return fs
})(),
},
{
Name: "daemon-bus-queues",
ShortUsage: "tailscale debug daemon-bus-queues",
Exec: runDaemonBusQueues,
ShortHelp: "Print event bus queue depths per client",
},
{
Name: "metrics",
ShortUsage: "tailscale debug metrics",
@@ -840,6 +846,15 @@ func runDaemonBusGraph(ctx context.Context, args []string) error {
return nil
}
func runDaemonBusQueues(ctx context.Context, args []string) error {
data, err := localClient.EventBusQueues(ctx)
if err != nil {
return err
}
fmt.Print(string(data))
return nil
}
// generateDOTGraph generates the DOT graph format based on the events
func generateDOTGraph(topics []eventbus.DebugTopic) string {
var sb strings.Builder