open-telemetry / opentelemetry-dotnet-contrib

This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
https://opentelemetry.io
Apache License 2.0
475 stars 283 forks source link

Getting rid of Newtonsoft.Json dependency in OpenTelemetry.Instrumentation.AWSLambda #1523

Closed birojnayak closed 10 months ago

birojnayak commented 10 months ago

This is not a bug but future direction for all AWS libraries those are part of Opentelemetry. We would like to make them AOT compatible

While investigating, OpenTelemetry.Instrumentation.AWSLambda takes dependency on Newtonsoft.Json. Are there any restriction on using System.Text.Json/JsonSerializer.Deserialize ? If not, let me know happy to submit PR.

                // AWSMessagingUtils , GetSnsMessage
                //snsMessage = JsonConvert.DeserializeObject<SNSEvent.SNSMessage>(body);
                snsMessage = JsonSerializer.Deserialize<SNSEvent.SNSMessage>(body);
birojnayak commented 10 months ago

@rypdal @Oberon00 ^^ thought on above

Oberon00 commented 10 months ago

Originally we used Newtonsoft because we wanted to support older .NET versions. But I had once already prepared a PR to remove the Newtonsoft depdendency: https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1270