From cdfd26331827e165c44ce72a38403a1bf922bd2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mats=20T=C3=B6rnberg?= Date: Thu, 13 Nov 2025 21:54:19 +0100 Subject: [PATCH] fetcher span --- cmd/cart/product-fetcher.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/cart/product-fetcher.go b/cmd/cart/product-fetcher.go index a6ab32f..95e8184 100644 --- a/cmd/cart/product-fetcher.go +++ b/cmd/cart/product-fetcher.go @@ -30,7 +30,9 @@ func getBaseUrl(country string) string { func FetchItem(ctx context.Context, sku string, country string) (*index.DataItem, error) { baseUrl := getBaseUrl(country) req, err := http.NewRequest("GET", fmt.Sprintf("%s/api/by-sku/%s", baseUrl, sku), nil) - req = req.WithContext(ctx) + innerCtx, span := tracer.Start(ctx, fmt.Sprintf("fetching data for %s", sku)) + defer span.End() + req = req.WithContext(innerCtx) if err != nil { return nil, err }