TUN-8731: Implement diag/system endpoint

## Summary
This PR will add a new endpoint, "diag/system" to the metrics server that collects system information from different operating systems.

Closes TUN-8731
This commit is contained in:
Luis Neto
2024-11-22 08:10:05 -08:00
parent e2c2b012f1
commit aab5364252
12 changed files with 1542 additions and 0 deletions

View File

@@ -15,6 +15,8 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/rs/zerolog"
"golang.org/x/net/trace"
"github.com/cloudflare/cloudflared/diagnostic"
)
const (
@@ -52,6 +54,7 @@ func GetMetricsKnownAddresses(runtimeType string) [5]string {
type Config struct {
ReadyServer *ReadyServer
DiagnosticHandler *diagnostic.Handler
QuickTunnelHostname string
Orchestrator orchestrator
@@ -91,6 +94,8 @@ func newMetricsHandler(
})
}
router.HandleFunc("/diag/system", config.DiagnosticHandler.SystemHandler)
return router
}