The README shows code snippets for how to integrate AWS clients with XRAY.
The sections I'm referring to are "AWS SDK Instrumentation" and "AWS SDK V2 Instrumentation".
The v1 snippet does not create a segment. The snippet will only work if a segment has already been created (or if run in a lambda where it is already available).
This is confusing because the two snippets are not doing the same thing. It is particularly confusing when migrating from SDKv1 to SDKv2 when your application runs in lambda. It looks as though you need to start creating segments which you never had to do before.
This should be improved so that both sections do the same thing. The creation of the segment could be included in both snippets with a comment that it isn't needed in lambda envs or other envs where the segment will be bootstrapped automatically.
The README shows code snippets for how to integrate AWS clients with XRAY.
The sections I'm referring to are "AWS SDK Instrumentation" and "AWS SDK V2 Instrumentation".
The v1 snippet does not create a segment. The snippet will only work if a segment has already been created (or if run in a lambda where it is already available).
The v2 snippet does create a segment.
This is confusing because the two snippets are not doing the same thing. It is particularly confusing when migrating from SDKv1 to SDKv2 when your application runs in lambda. It looks as though you need to start creating segments which you never had to do before.
This should be improved so that both sections do the same thing. The creation of the segment could be included in both snippets with a comment that it isn't needed in lambda envs or other envs where the segment will be bootstrapped automatically.