mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-26 12:35:35 +02:00
Add Prometheus metrics endpoint with local-bind listener support and baseline metrics collectors.
24 lines
647 B
Go
24 lines
647 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
"github.com/multica-ai/multica/server/internal/analytics"
|
|
"github.com/multica-ai/multica/server/internal/events"
|
|
"github.com/multica-ai/multica/server/internal/realtime"
|
|
)
|
|
|
|
func TestMainRouterDoesNotExposePrometheusMetrics(t *testing.T) {
|
|
router := NewRouter(nil, realtime.NewHub(), events.New(), analytics.NoopClient{}, nil)
|
|
|
|
rec := httptest.NewRecorder()
|
|
req := httptest.NewRequest(http.MethodGet, "/metrics", nil)
|
|
router.ServeHTTP(rec, req)
|
|
|
|
if rec.Code != http.StatusNotFound {
|
|
t.Fatalf("main API /metrics status = %d, want %d", rec.Code, http.StatusNotFound)
|
|
}
|
|
}
|