Take control over your live stream video by running it yourself. Streaming + chat out of the box.
HTML activitypubbroadcastingchatdecentralizedfederationfediversegolanghacktoberfesthlslivelivestreamowncastrtmpself-hostedstreaming-videovideo
Fix prometheus handlers (#4311)
mahmed2000963f35f9fa60
diff --git a/test/automated/.gitignore b/test/automated/.gitignoreindex ecd859df58..3a094afda9 100644--- a/test/automated/.gitignore+++ b/test/automated/.gitignore@@ -1,2 +1,2 @@node_modules-ffmpeg+ffmpeg-*/diff --git a/test/automated/api/006_integrations.test.js b/test/automated/api/006_integrations.test.jsindex ef76b41588..dfc93f9200 100644--- a/test/automated/api/006_integrations.test.js+++ b/test/automated/api/006_integrations.test.js@@ -172,3 +172,8 @@ test('send an external integration action using access token expecting failure',.send(payload).expect(401);});++test('test prometheus metrics', async() => {+ const res = await getAdminResponse('prometheus');+ expect(res.text).toMatch(/owncast_instance_cpu_usage/);+});diff --git a/webserver/handlers/integrations.go b/webserver/handlers/integrations.goindex 2716f916b0..be587ddfc8 100644--- a/webserver/handlers/integrations.go+++ b/webserver/handlers/integrations.go@@ -95,34 +95,34 @@ func (*ServerInterfaceImpl) ExternalGetStatus(w http.ResponseWriter, r *http.Reqfunc (*ServerInterfaceImpl) GetPrometheusAPI(w http.ResponseWriter, r *http.Request) {// might need to bring this out of the codegenmiddleware.RequireAdminAuth(func(w http.ResponseWriter, r *http.Request) {- promhttp.Handler()+ promhttp.Handler().ServeHTTP(w, r)})(w, r)}func (*ServerInterfaceImpl) PostPrometheusAPI(w http.ResponseWriter, r *http.Request) {// might need to bring this out of the codegenmiddleware.RequireAdminAuth(func(w http.ResponseWriter, r *http.Request) {- promhttp.Handler()+ promhttp.Handler().ServeHTTP(w, r)})(w, r)}func (*ServerInterfaceImpl) PutPrometheusAPI(w http.ResponseWriter, r *http.Request) {// might need to bring this out of the codegenmiddleware.RequireAdminAuth(func(w http.ResponseWriter, r *http.Request) {- promhttp.Handler()+ promhttp.Handler().ServeHTTP(w, r)})(w, r)}func (*ServerInterfaceImpl) DeletePrometheusAPI(w http.ResponseWriter, r *http.Request) {// might need to bring this out of the codegenmiddleware.RequireAdminAuth(func(w http.ResponseWriter, r *http.Request) {- promhttp.Handler()+ promhttp.Handler().ServeHTTP(w, r)})(w, r)}func (*ServerInterfaceImpl) OptionsPrometheusAPI(w http.ResponseWriter, r *http.Request) {// might need to bring this out of the codegenmiddleware.RequireAdminAuth(func(w http.ResponseWriter, r *http.Request) {- promhttp.Handler()+ promhttp.Handler().ServeHTTP(w, r)})(w, r)}