You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go-http-metrics knows how to measure http metrics in different metric formats. The metrics measured are based on [RED] and/or [Four golden signals], follow standards and try to be measured in a efficient way.
4
-
5
-
It measures based on a middleware that is compatible with Go core net/http handler, if you are using a framework that isn't directly compatible with go's `http.Handler` interface, do not worry, there are multiple helpers available to get middlewares for the most used http Go frameworks. If there isn't you can open an issue or a PR.
3
+
go-http-metrics knows how to measure http metrics in different metric formats a different Go HTTP framework/libs. The metrics measured are based on [RED] and/or [Four golden signals], follow standards and try to be measured in a efficient way.
myHandler:= http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
69
+
h:= http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
71
70
w.WriteHeader(http.StatusOK)
72
71
w.Write([]byte("hello world!"))
73
72
})
74
-
h:= mdlw.Handler("", myHandler)
73
+
h = middlewarestd.Handler("", mdlw, h)
75
74
76
75
// Serve metrics.
77
76
log.Printf("serving metrics at: %s", ":9090")
@@ -196,18 +195,6 @@ Same options as the Prometheus recorder.
196
195
197
196
This Option is used to unregister the Recorder views before are being registered, this is option is mainly due to the nature of OpenCensus implementation and the huge usage fo global state making impossible to run multiple tests. On regular usage of the library this setting is very rare that needs to be used.
0 commit comments