From 2d7557686401d96fcdfd34f9377b6d2537a7867f Mon Sep 17 00:00:00 2001 From: Silvan Date: Thu, 7 Sep 2023 10:59:44 +0200 Subject: [PATCH] fix(scheduler): add span to trigger method (#6513) --- internal/eventstore/handler/handler_projection.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/eventstore/handler/handler_projection.go b/internal/eventstore/handler/handler_projection.go index 2dbcfc9aa0..382a05b123 100644 --- a/internal/eventstore/handler/handler_projection.go +++ b/internal/eventstore/handler/handler_projection.go @@ -13,6 +13,7 @@ import ( "github.com/zitadel/zitadel/internal/api/call" "github.com/zitadel/zitadel/internal/eventstore" "github.com/zitadel/zitadel/internal/repository/pseudo" + "github.com/zitadel/zitadel/internal/telemetry/tracing" ) const ( @@ -141,6 +142,9 @@ func (h *ProjectionHandler) Trigger(ctx context.Context, instances ...string) co // If a bulk action was executed, the call timestamp in context will be reset for subsequent queries. // The returned context is never nil. It is either the original context or an updated context. func (h *ProjectionHandler) TriggerErr(ctx context.Context, instances ...string) (outCtx context.Context, err error) { + ctx, span := tracing.NewSpan(ctx) + defer span.EndWithError(err) + instances = triggerInstances(ctx, instances) defer func() { outCtx = call.ResetTimestamp(ctx)