From aeb8f05865f9cda530b4914e947aab8eada2e29d Mon Sep 17 00:00:00 2001 From: Joseph Kruskal <99559985+kruskall@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:36:52 +0200 Subject: [PATCH] fix: propagate and handle metadata errors (#254) metadata processing errors were being logged and ignored leading a nil metadata. --- apm-lambda-extension/apmproxy/apmserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apm-lambda-extension/apmproxy/apmserver.go b/apm-lambda-extension/apmproxy/apmserver.go index b48de5a8..c0ab00e1 100644 --- a/apm-lambda-extension/apmproxy/apmserver.go +++ b/apm-lambda-extension/apmproxy/apmserver.go @@ -47,7 +47,7 @@ func (c *Client) ForwardApmData(ctx context.Context, metadataContainer *Metadata if metadataContainer.Metadata == nil { metadata, err := ProcessMetadata(agentData) if err != nil { - extension.Log.Errorf("Error extracting metadata from agent payload %v", err) + return fmt.Errorf("failed to extract metadata from agent payload %w", err) } metadataContainer.Metadata = metadata }