Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: XRay Tracing not showing on Lambda timeouts #245

Closed
JohnHarkendorff opened this issue Apr 14, 2023 · 3 comments
Closed

Bug: XRay Tracing not showing on Lambda timeouts #245

JohnHarkendorff opened this issue Apr 14, 2023 · 3 comments

Comments

@JohnHarkendorff
Copy link

Expected Behaviour

Tracing segments are shown when a Lambda times out

Current Behaviour

No tracing segments are shown

Code snippet

using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;
using Amazon.Lambda.APIGatewayEvents;
using Amazon.Lambda.Core;
using Amazon.S3;
using AWS.Lambda.Powertools.Logging;
using AWS.Lambda.Powertools.Tracing;
using Microsoft.Extensions.DependencyInjection;

[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))]
namespace SecondaryQualityLambda
{
    public class Function
    {
        public Function()
        {
        }

        [Logging(ClearState = true)]
        [Tracing(CaptureMode = TracingCaptureMode.ResponseAndError)]
        public async Task<APIGatewayProxyResponse> Handler(APIGatewayProxyRequest request)
        {
            // Set a 5 second timeout on the Lambda
            await Task.Delay(10000);
            return new APIGatewayProxyResponse
            {
                 StatusCode = (int)HttpStatusCode.OK,
            };
        }
    }
}

Possible Solution

No response

Steps to Reproduce

  1. Create a Lambda with a 5-second timeout and Tracing enable
  2. Upload code to the Lambda that pauses for 10 seconds
  3. Execute the Lambda

Would expect, in the code provided, to see ## Handler in the traces, but instead only see "Invocation".

AWS Lambda Powertools for .NET version

latest

AWS Lambda function runtime

dotnet6

Debugging logs

No response

@JohnHarkendorff JohnHarkendorff added bug Unexpected, reproducible and unintended software behaviour triage Pending triage from maintainers labels Apr 14, 2023
@hjgraca
Copy link
Contributor

hjgraca commented Apr 15, 2023

@JohnHarkendorff thanks for reporting. Will get back to you as soon as we can repro

@hjgraca hjgraca moved this to 📋 Backlog in AWS Lambda Powertools for .NET Apr 15, 2023
@heitorlessa
Copy link
Contributor

heitorlessa commented Apr 15, 2023 via email

@hjgraca hjgraca added enhancement and removed bug Unexpected, reproducible and unintended software behaviour triage Pending triage from maintainers labels Apr 18, 2023
@hjgraca hjgraca moved this from 📋 Backlog to Ideas in AWS Lambda Powertools for .NET Apr 19, 2023
@hjgraca
Copy link
Contributor

hjgraca commented Apr 19, 2023

@JohnHarkendorff also refer to the existing issues aws/aws-xray-sdk-dotnet#265. and aws/aws-xray-sdk-node#446 (comment).

Like @heitorlessa mentioned there can be a possibility by using extensions. I will investigate if there is a way in .NET to do something similar to what Heitor did for python.

@hjgraca hjgraca closed this as completed Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants