Closed tanaka-takayoshi closed 4 months ago
Hi @tanaka-takayoshi Can you provide a simple repro code or a code snippet of your lambda function demonstrating the instrumentation? Also, what's the .Net runtime you're using for your function?
After investigating my end, I finally found AWS X-Ray configuration is required when using AddAWSLambdaConfigurations
method even if the trace is not sent to X-Ray but to other OTLP endpoint.
The lambda should have AWSXrayWriteOnlyAccess
policy and Tracing should be Active.
Is it intended behavior?
@tanaka-takayoshi I am having the same problem. How did you manage to solve? What do you mean by AWS X-Ray configuration is required
?
@dglozano I enabled "Active tracing" by following the doc and added AWSXrayWriteOnlyAccess policy to a Lambda function. https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html
According to this issue, AWSXrayWriteOnlyAccess policy might have been deprecated and AWSXRayDaemonWriteAccess should work. However, I confirmed with AWSXrayWriteOnlyAccess. I haven't tested with AWSXRayDaemonWriteAccess.
We observed that when X-Ray is disabled, it will still pass an X-Ray trace ID to the Lambda but with the sampled flag not set. Thus, no Activity will be started by the instrumentation. Since 1.1.0-beta.2, there is an option AWSLambdaInstrumentationOptions.DisableAwsXRayContextExtraction
that you can set during initialization that will disable parsing the X-Ray trace ID and thus should still create an activity without extra AWS/Lambda configuration. Does this solve your issue?
Stale issue. Closing based on @Oberon00 message. Please reopen if needed.
When using AWS OTel .NET SDK with exmaple code, SDK didn't create parent span in descirbed here: https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/src/OpenTelemetry.Contrib.Instrumentation.AWSLambda/Implementation/AWSLambdaWrapper.cs#L226
Due to this, HTTP Client span and AWS SDK clint span are created as a separated trace.
Here is a output when using Console Exporter.