1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-11-29 23:07:40 +02:00

Move metrics.StartRequest to middleware && Fix Datadog

This commit is contained in:
DarthSim
2022-01-14 00:40:14 +06:00
parent e43c24c544
commit b5863c808b
7 changed files with 39 additions and 3 deletions

View File

@@ -26,6 +26,12 @@ func Stop() {
datadog.Stop()
}
func Enabled() bool {
return prometheus.Enabled() ||
newrelic.Enabled() ||
datadog.Enabled()
}
func StartRequest(ctx context.Context, rw http.ResponseWriter, r *http.Request) (context.Context, context.CancelFunc, http.ResponseWriter) {
promCancel := prometheus.StartRequest()
ctx, nrCancel, rw := newrelic.StartTransaction(ctx, rw, r)