From e3feb5542cdb81f1e3d00d18a78f4c7c2023fb26 Mon Sep 17 00:00:00 2001 From: Raj Date: Thu, 10 Oct 2024 09:24:17 +0530 Subject: [PATCH] chore: signozlogspipelineprocessor: use jsoniter for parsing body JSON --- .../signozlogspipelineprocessor/stanza/entry/body_field.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/processor/signozlogspipelineprocessor/stanza/entry/body_field.go b/processor/signozlogspipelineprocessor/stanza/entry/body_field.go index 9d8d2852..43001fd9 100644 --- a/processor/signozlogspipelineprocessor/stanza/entry/body_field.go +++ b/processor/signozlogspipelineprocessor/stanza/entry/body_field.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" + jsoniter "github.com/json-iterator/go" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry" ) @@ -83,7 +84,7 @@ func parseBodyJson(entry *entry.Entry) map[string]any { if hasBytes { var parsedBody map[string]any - err := json.Unmarshal(bodyBytes, &parsedBody) + err := jsoniter.ConfigFastest.Unmarshal(bodyBytes, &parsedBody) if err == nil { // Attributes keys starting with InternalTempAttributePrefix // get ignored when entries are converted back to plog.Logs