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]: HTTP Information Not Available In X Ray Headers #427

Open
5t33 opened this issue Jul 15, 2023 · 4 comments
Open

[Bug]: HTTP Information Not Available In X Ray Headers #427

5t33 opened this issue Jul 15, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@5t33
Copy link

5t33 commented Jul 15, 2023

Which web client version did you detect this bug with?

v1.14.0

What environment (build systems, module system, and framework) did you detect this bug with?

TypeScript v4.7.4, node v19.7.0, React ^17.0.0

Is your web application a single page application (SPA) or multi page application (MPA)?

None

Please provide your web client configuration

      const config: AwsRumConfig = {
        allowCookies: true,
        enableXRay: true,
        guestRoleArn: awsRumGuestRoleArn,
        identityPoolId: awsRumIdentityPoolId,
        sessionSampleRate: sessionSampleRate,
        telemetries: [
          'errors', 
          [ "performance", {recordAllTypes: ['document', 'script', 'other']} ],
          [ 'http', {
            recordAllRequests: true,
            addXRayTraceIdHeader: true,
            urlsToExclude: [
              new RegExp('/audio-samples/.+'),
              new RegExp('https://dataplane.rum.us-west-2.amazonaws.com/.+')
            ]
          } ]],
        eventPluginsToLoad: []
      };

Please describe the bug/issue

Hi,

I'm seeing HTTP traces coming from my app in my X Ray console, however, they lack any headers that allow me to sort or filter them.

I have X Ray set up on the backend with this package: https://github.com/narando/nest-xray. For reference, this is how my X Ray console looks without the RUM X Ray segments:

Screenshot 2023-07-15 at 5 53 30 PM

As you can see, URLs and status codes are sortable & filterable. However, when I implement RUM, I get this:
Screenshot 2023-07-15 at 6 02 51 PM

Only trace IDs. And when you dig into the trace, you can see that the top level of the trace doesn't include the HTTP info:
Screenshot 2023-07-14 at 2 17 55 PM

It's somehow obscured by the parent "app monitor" trace.

Is this something in my set up?

@haotiantest
Copy link
Contributor

Hey Steven, in the trace tables, they are showing segment infomations, but when RUM web client generate traces, we put http object in the sub-segment document, that's why it's not showing in the table but if you look at the raw segment data you will able to see it there. We will evluate to see if we can add http object into segment level as well.

@qhanam
Copy link
Member

qhanam commented Nov 17, 2023

I agree with @5t33 -- I think this is worth fixing. The top-level trace segment is effectively the HTTP request, and so it should contain all the properties of the HTTP request.

As shown in the screenshot, the X-Ray console only shows the status/response time/http method/url of the root trace segment. Among other things, this makes it difficult to select a trace for debugging purposes.

@qhanam qhanam added the bug Something isn't working label Apr 22, 2024
@flochaz
Copy link

flochaz commented Oct 7, 2024

Inspecting the raw trace, it is linked to the fact that root segment is not in it. So the issue is probably due to the fact that the root segment that should come from RUM is not received by XRay or is getting in late.
I got a full trace properly built :
image
And then I guess the URL in traces :
image

Will continue to investigate why it randomly works ...

@flochaz
Copy link

flochaz commented Oct 7, 2024

On my side the issue was the way I was setting my regex for addXRayTraceIdHeader. Not sure what was wrong with new RegExp constructor but going straight for a regex like addXRayTraceIdHeader: [/api\.\w+\.example\.com/], worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants