mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 12:27:59 +00:00
25ef3da9d5
chore(fmt): run gci on complete project Fix global import formatting in go code by running the `gci` command. This allows us to just use the command directly, instead of fixing the import order manually for the linter, on each PR. Co-authored-by: Elio Bischof <elio@zitadel.com>
20 lines
607 B
Go
20 lines
607 B
Go
package middleware
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
http_utils "github.com/zitadel/zitadel/internal/api/http"
|
|
"github.com/zitadel/zitadel/internal/telemetry/metrics"
|
|
)
|
|
|
|
func DefaultMetricsHandler(handler http.Handler) http.Handler {
|
|
metricTypes := []metrics.MetricType{metrics.MetricTypeTotalCount}
|
|
return MetricsHandler(metricTypes, http_utils.Probes...)(handler)
|
|
}
|
|
|
|
func MetricsHandler(metricTypes []metrics.MetricType, ignoredMethods ...string) func(http.Handler) http.Handler {
|
|
return func(handler http.Handler) http.Handler {
|
|
return metrics.NewMetricsHandler(handler, metricTypes, ignoredMethods...)
|
|
}
|
|
}
|