From 4da5793101da312316732cfad4d4a1a1c5a6e388 Mon Sep 17 00:00:00 2001 From: Joe Lombrozo Date: Fri, 29 May 2026 10:34:47 -0700 Subject: [PATCH] add useful info to trace --- packages/api/internal/cache/templates/cache.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/api/internal/cache/templates/cache.go b/packages/api/internal/cache/templates/cache.go index 489ba6432f..f32538f31f 100644 --- a/packages/api/internal/cache/templates/cache.go +++ b/packages/api/internal/cache/templates/cache.go @@ -9,6 +9,8 @@ import ( "github.com/google/uuid" "github.com/redis/go-redis/v9" "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" "github.com/e2b-dev/infra/packages/api/internal/api" sqlcdb "github.com/e2b-dev/infra/packages/db/client" @@ -109,7 +111,12 @@ func (c *TemplateCache) GetMetadata(ctx context.Context, templateID string) (*Te // Does NOT do alias resolution - callers should use ResolveAlias first. // Performs access control and cluster checks. func (c *TemplateCache) Get(ctx context.Context, templateID string, tag *string, teamID uuid.UUID, clusterID uuid.UUID) (*api.Template, *queries.EnvBuild, error) { - ctx, span := tracer.Start(ctx, "get template") + ctx, span := tracer.Start(ctx, "get template", trace.WithAttributes( + attribute.String("template_id", templateID), + attribute.String("tag", sharedUtils.DerefOrDefault(tag, "")), + attribute.String("team_id", teamID.String()), + attribute.String("cluster_id", clusterID.String()), + )) defer span.End() // Step 1: Get template with build by ID and tag