Skip to content

Commit 3b37d0b

Browse files
authored
🔧 #220 Instrument API server (#255)
1 parent 321b002 commit 3b37d0b

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99
github.com/aws/aws-sdk-go-v2/service/bedrockruntime v1.5.6
1010
github.com/go-playground/validator/v10 v10.17.0
1111
github.com/gofiber/contrib/fiberzap/v2 v2.1.2
12+
github.com/gofiber/contrib/otelfiber v1.0.10
1213
github.com/gofiber/contrib/websocket v1.3.0
1314
github.com/gofiber/fiber/v2 v2.52.2
1415
github.com/gofiber/swagger v1.0.0
@@ -78,6 +79,7 @@ require (
7879
github.com/valyala/bytebufferpool v1.0.0 // indirect
7980
github.com/valyala/fasthttp v1.52.0 // indirect
8081
github.com/valyala/tcplisten v1.0.0 // indirect
82+
go.opentelemetry.io/contrib v1.17.0 // indirect
8183
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.26.0 // indirect
8284
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.26.0 // indirect
8385
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 // indirect

go.sum

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/http/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/EinStack/glide/docs"
1212

1313
"github.com/gofiber/contrib/fiberzap/v2"
14+
"github.com/gofiber/contrib/otelfiber"
1415

1516
_ "github.com/EinStack/glide/docs" // importing docs package to include them into the binary
1617

@@ -30,6 +31,7 @@ type Server struct {
3031

3132
func NewServer(config *ServerConfig, tel *telemetry.Telemetry, routerManager *routers.RouterManager) (*Server, error) {
3233
srv := config.ToServer()
34+
srv.Use(otelfiber.Middleware())
3335

3436
return &Server{
3537
config: config,

0 commit comments

Comments
 (0)