Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Fix prometheus handlers (#4311)

mahmed2000963f35f9fa60
diff --git a/test/automated/.gitignore b/test/automated/.gitignore
index 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.js
index 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.go
index 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.Req
func (*ServerInterfaceImpl) GetPrometheusAPI(w http.ResponseWriter, r *http.Request) {
// might need to bring this out of the codegen
middleware.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 codegen
middleware.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 codegen
middleware.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 codegen
middleware.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 codegen
middleware.RequireAdminAuth(func(w http.ResponseWriter, r *http.Request) {
- promhttp.Handler()
+ promhttp.Handler().ServeHTTP(w, r)
})(w, r)
}