From 7e116ded194730ba841cfc9d5664990fe6920f1f Mon Sep 17 00:00:00 2001 From: jakeschuurmans <143427381+jakeschuurmans@users.noreply.github.com> Date: Mon, 16 Oct 2023 09:32:59 -0400 Subject: [PATCH] Adding conditionKind values to traces (#91) * Adding conditionKind values to traces * remove error path --- internal/worker/worker.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/worker/worker.go b/internal/worker/worker.go index 2daf1bf3..ec1fd776 100644 --- a/internal/worker/worker.go +++ b/internal/worker/worker.go @@ -23,6 +23,7 @@ import ( "go.hollow.sh/toolbox/events/pkg/kv" "go.hollow.sh/toolbox/events/registry" "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" cpv1types "github.com/metal-toolbox/conditionorc/pkg/api/v1/types" @@ -271,6 +272,8 @@ func (o *Worker) processSingleEvent(ctx context.Context, e events.Message) { return } + span.SetAttributes(attribute.KeyValue{Key: "conditionKind", Value: attribute.StringValue(condition.ID.String())}) + // check and see if the task is or has-been handled by another worker currentState := o.taskInProgress(condition.ID.String()) switch currentState {