Fix prometheus handlers (#4311)

* fix prometheus handlers not serving responses

* add basic integration test to prometheus handler

* modify .gitignore to ignore all ffmpeg versioned folders instead of just any file exactly matching "ffmpeg"
This commit is contained in:
mahmed2000
2025-05-03 23:27:08 -07:00
committed by GitHub
parent 00be7720b5
commit 9a0e487d54
3 changed files with 11 additions and 6 deletions
+5 -5
View File
@@ -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)
}