From f8865c48afc9e493241ad620cfb2bd058b4a1833 Mon Sep 17 00:00:00 2001 From: rubvs Date: Tue, 6 Aug 2024 09:51:22 -0400 Subject: [PATCH] fix otel exception message propagation (#13603) --- model/modelprocessor/errormessage.go | 2 +- model/modelprocessor/errormessage_test.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/model/modelprocessor/errormessage.go b/model/modelprocessor/errormessage.go index efc1c293..6094bbe9 100644 --- a/model/modelprocessor/errormessage.go +++ b/model/modelprocessor/errormessage.go @@ -32,7 +32,7 @@ func (s SetErrorMessage) ProcessBatch(ctx context.Context, b *modelpb.Batch) err for i := range *b { event := (*b)[i] if event.Error != nil { - event.Message = s.setErrorMessage(event) + event.Error.Message = s.setErrorMessage(event) } } return nil diff --git a/model/modelprocessor/errormessage_test.go b/model/modelprocessor/errormessage_test.go index 60757e18..dd94d82e 100644 --- a/model/modelprocessor/errormessage_test.go +++ b/model/modelprocessor/errormessage_test.go @@ -59,7 +59,6 @@ func TestSetErrorMessage(t *testing.T) { processor := modelprocessor.SetErrorMessage{} err := processor.ProcessBatch(context.Background(), &batch) assert.NoError(t, err) - assert.Equal(t, test.message, batch[0].Message) + assert.Equal(t, test.message, batch[0].Error.Message) } - }