mirror of
https://github.com/nais/wonderwall.git
synced 2026-08-23 21:16:14 +00:00
style: go fmt
This commit is contained in:
@@ -393,7 +393,8 @@ func TestNonNavigationalRequests(t *testing.T) {
|
||||
} {
|
||||
t.Run("with fetch metadata", func(t *testing.T) {
|
||||
rpClient := idp.RelyingPartyClient()
|
||||
resp := get(t, rpClient, idp.RelyingPartyServer.URL+path,
|
||||
resp := get(
|
||||
t, rpClient, idp.RelyingPartyServer.URL+path,
|
||||
header{"Sec-Fetch-Mode", "cors"},
|
||||
header{"Sec-Fetch-Dest", "empty"},
|
||||
)
|
||||
|
||||
@@ -180,7 +180,8 @@ func TestReverseProxy(t *testing.T) {
|
||||
|
||||
t.Run("with fetch metadata", func(t *testing.T) {
|
||||
target := idp.RelyingPartyServer.URL + "/"
|
||||
resp := get(t, rpClient, target,
|
||||
resp := get(
|
||||
t, rpClient, target,
|
||||
header{"Sec-Fetch-Mode", "cors"},
|
||||
header{"Sec-Fetch-Dest", "empty"},
|
||||
)
|
||||
|
||||
@@ -46,12 +46,13 @@ func Prometheus(provider string, buckets ...float64) *PrometheusMiddleware {
|
||||
if len(buckets) == 0 {
|
||||
buckets = defaultBuckets
|
||||
}
|
||||
m.latency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
|
||||
Name: latencyName,
|
||||
Help: "How long it took to process the request, partitioned by status code, method and HTTP path.",
|
||||
ConstLabels: prometheus.Labels{"service": serviceName, metrics.LabelProvider: provider},
|
||||
Buckets: buckets,
|
||||
},
|
||||
m.latency = prometheus.NewHistogramVec(
|
||||
prometheus.HistogramOpts{
|
||||
Name: latencyName,
|
||||
Help: "How long it took to process the request, partitioned by status code, method and HTTP path.",
|
||||
ConstLabels: prometheus.Labels{"service": serviceName, metrics.LabelProvider: provider},
|
||||
Buckets: buckets,
|
||||
},
|
||||
[]string{"code", "method", "path", "host"},
|
||||
)
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ func New(src Source, cfg *config.Config) chi.Router {
|
||||
r := chi.NewRouter()
|
||||
r.Use(middleware.CorrelationIDHandler)
|
||||
if cfg.OpenTelemetry.Enabled {
|
||||
r.Use(otelchi.Middleware(cfg.OpenTelemetry.ServiceName,
|
||||
r.Use(otelchi.Middleware(
|
||||
cfg.OpenTelemetry.ServiceName,
|
||||
otelchi.WithChiRoutes(r),
|
||||
otelchi.WithRequestMethodInSpanName(true),
|
||||
otelchi.WithFilter(func(r *http.Request) bool {
|
||||
|
||||
Reference in New Issue
Block a user