You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to use X-Ray to trace AWS SDK calls we have in a natively-compiled .NET Lambda function. In our function's Main method, we're calling AWSSDKHandler.RegisterXRayForAllServices();. When we actually use an SDK for the first time -- still in the Main method -- we get the following error/stack trace:
Unhandled Exception: System.ArgumentException: The value "JsonData object" is not of type "Amazon.XRay.Recorder.Handlers.AwsSdk.Entities.AWSServiceHandler" and cannot be used in this generic collection. (Parameter 'value')
at System.ThrowHelper.ThrowWrongValueTypeArgumentException[T](T, Type) + 0x17
at System.Collections.Generic.Dictionary`2.System.Collections.IDictionary.Add(Object, Object) + 0xbb
at ThirdParty.LitJson.JsonMapper.ReadValue(Type inst_type, JsonReader reader) + 0x5f0
at ThirdParty.LitJson.JsonMapper.ReadValue(Type inst_type, JsonReader reader) + 0x55e
at ThirdParty.LitJson.JsonMapper.ToObject[T](TextReader reader) + 0x5f
at Amazon.XRay.Recorder.Handlers.AwsSdk.Internal.XRayPipelineHandler.GetAWSServiceHandlerManifest(Stream stream) + 0x6d
at Amazon.XRay.Recorder.Handlers.AwsSdk.Internal.XRayPipelineHandler.GetDefaultAWSWhitelist() + 0x47
at Amazon.XRay.Recorder.Handlers.AwsSdk.Internal.XRayPipelineHandler..ctor() + 0x1e
at Amazon.XRay.Recorder.Handlers.AwsSdk.Internal.XRayPipelineCustomizer.Customize(Type serviceClientType, RuntimePipeline pipeline) + 0x77
at Amazon.Runtime.Internal.RuntimePipelineCustomizerRegistry.ApplyCustomizations(Type type, RuntimePipeline pipeline) + 0xad
at LambdaFunction.<Main>d__14.MoveNext() + 0x97
We've removed X-Ray to verify that the function works without it, and we've also deployed it without native AOT-compilation, and that works, also. In addition, I tried to copy the DefaultAWSWhitelist.json and register the manifest manually, but that yielded the same result as letting it happen from within the library.
Because this works without the trimming that occurs when publishing as a native executable, I'm assuming there's something being trimmed that we need to keep around by "rooting" the assembly. I haven't figured out what assembly that is or if there is some other problem at play. Any ideas?
Same issue here... Is the X-Ray SDK for .NET even maintained anymore? I don't see any activity for the past 4 months and they do reference Open Telemetry. With the push AWS has made for using AOT on Lambda, I am perplexed that this has been sitting out here so long....
We want to use X-Ray to trace AWS SDK calls we have in a natively-compiled .NET Lambda function. In our function's
Main
method, we're callingAWSSDKHandler.RegisterXRayForAllServices();
. When we actually use an SDK for the first time -- still in theMain
method -- we get the following error/stack trace:We've removed X-Ray to verify that the function works without it, and we've also deployed it without native AOT-compilation, and that works, also. In addition, I tried to copy the DefaultAWSWhitelist.json and register the manifest manually, but that yielded the same result as letting it happen from within the library.
Because this works without the trimming that occurs when publishing as a native executable, I'm assuming there's something being trimmed that we need to keep around by "rooting" the assembly. I haven't figured out what assembly that is or if there is some other problem at play. Any ideas?
This may be related to #295.
Thanks.
The text was updated successfully, but these errors were encountered: