feat(instrumentation): added gauge and http endpoint

This commit is contained in:
Torkel Ödegaard
2016-06-03 16:15:36 +02:00
parent 1a05ae2eaa
commit e0c6048820
8 changed files with 103 additions and 141 deletions

View File

@@ -15,8 +15,8 @@ var (
NotFound = func() Response {
return ApiError(404, "Not found", nil)
}
ServerError = func() Response {
return ApiError(500, "Server error", nil)
ServerError = func(err error) Response {
return ApiError(500, "Server error", err)
}
)
@@ -38,7 +38,7 @@ func wrap(action interface{}) macaron.Handler {
if err == nil && val != nil && len(val) > 0 {
res = val[0].Interface().(Response)
} else {
res = ServerError()
res = ServerError(err)
}
res.WriteTo(c.Resp)