Skip to content

Commit c6f70ca

Browse files
committed
bff: improve opentelemetry
Signed-off-by: Viktor Login <[email protected]>
1 parent f93327d commit c6f70ca

File tree

1 file changed

+3
-1
lines changed
  • boundaries/bff/internal/infrastructure/http

1 file changed

+3
-1
lines changed

boundaries/bff/internal/infrastructure/http/server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import (
88
flight_trace_middleware "github.com/shortlink-org/go-sdk/http/middleware/flight_trace"
99
"github.com/shortlink-org/go-sdk/logger"
1010
"github.com/spf13/viper"
11+
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
1112
"golang.org/x/sync/errgroup"
1213
"google.golang.org/protobuf/encoding/protojson"
1314

1415
"github.com/shortlink-org/go-sdk/http/handler"
15-
auth_middleware "github.com/shortlink-org/go-sdk/http/middleware/auth"
16+
auth_middleware "github.com/shortlink-org/go-sdk/http/middleware/auth"
1617
csrf_middleware "github.com/shortlink-org/go-sdk/http/middleware/csrf"
1718
logger_middleware "github.com/shortlink-org/go-sdk/http/middleware/logger"
1819
metrics_middleware "github.com/shortlink-org/go-sdk/http/middleware/metrics"
@@ -79,6 +80,7 @@ func (api *Server) run(config Config) error {
7980
r.Use(auth_middleware.Auth(config.Config))
8081
r.Use(pprof_labels_middleware.Labels)
8182
r.Use(flight_trace_middleware.DebugTraceMiddleware(config.FlightTrace, config.Log, config.Config))
83+
r.Use(otelhttp.NewMiddleware(config.Config.GetString("SERVICE_NAME")))
8284

8385
// Metrics
8486
metrics, err := metrics_middleware.NewMetrics()

0 commit comments

Comments
 (0)