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

fix(tracer): include request pathname in trace data #2955

Merged
merged 3 commits into from
Sep 10, 2024

Conversation

dreamorosi
Copy link
Contributor

Summary

Changes

Please provide a summary of what's being changed

This PR modifies the internal implementation of the Tracer patching for the fetch request module so that it includes the pathname of a request in the segment data.

As reported in the linked issue, the current implementation only records the host name, so a request to https://aws.amazon.com/free would generate a segment similar to this:

{
  "id": "45b22f447784c44f",
  "name": "aws.amazon.com",
  "start_time": 1724108234.18,
  "namespace": "remote",
  "http": {
    "request": {
      "url": "aws.amazon.com",
      "method": "GET"
    },
    "response": {
      "status": 301,
      "content_length": 0
    }
  },
  "end_time": 1724108234.849
}

while it should have generated one like this:

{
  "id": "e861c05fa31a14ab",
  "name": "aws.amazon.com",
  "start_time": 1724108234.856,
  "namespace": "remote",
  "http": {
    "request": {
      "url": "https://aws.amazon.com/free",
      "method": "GET"
    },
    "response": {
      "status": 301,
      "content_length": 0
    }
  },
  "end_time": 1724108235.218
}

Notice how the http.request.url includes both the path and protocol.

The PR also modifies and adds some unit tests to account for the updated logic.

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: closes #2954


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi dreamorosi self-assigned this Aug 20, 2024
@dreamorosi dreamorosi requested review from a team as code owners August 20, 2024 11:06
@boring-cyborg boring-cyborg bot added tests PRs that add or change tests tracer This item relates to the Tracer Utility labels Aug 20, 2024
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Aug 20, 2024
@github-actions github-actions bot added the bug Something isn't working label Aug 20, 2024
Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVED!

@dreamorosi dreamorosi added the do-not-merge This item should not be merged label Aug 26, 2024
Copy link

@dreamorosi
Copy link
Contributor Author

@dreamorosi dreamorosi removed the do-not-merge This item should not be merged label Sep 10, 2024
Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVED!

@dreamorosi dreamorosi merged commit 6864e53 into main Sep 10, 2024
36 checks passed
@dreamorosi dreamorosi deleted the fix/tracer_fetch_pathname branch September 10, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/L PRs between 100-499 LOC tests PRs that add or change tests tracer This item relates to the Tracer Utility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Fetch traces only capture the hostname of the request URL
2 participants