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

Add server.address attribute to http.client spans #11632

Closed
gggritso opened this issue Apr 16, 2024 · 1 comment · Fixed by #11634
Closed

Add server.address attribute to http.client spans #11632

gggritso opened this issue Apr 16, 2024 · 1 comment · Fixed by #11634

Comments

@gggritso
Copy link
Member

Problem Statement

http.client spans can have relative URLs. Relative URLs are tricky for a few reasons:

  1. Without a base URL, we can't reconstruct the full URL using JavaScript's URL or other validating URL parsers. We resort to adding dummy base URLs
  2. Without a base URL, we can't extract the span.domain tag

We can work around this by fetching the current URL from the transaction's request attribute, but this is awkward (the URL needs to be parsed) and might not hold up in a spans-only world, depending on how propagation of this data works.

Solution Brainstorm

It would be great if spans had a server.address attribute. As described in OTel's documentation, the attribute would hold the domain of the URL that was accessed.

This would make it much easier and more robust to parse the domain, reconstruct the URL, etc. Might be good to support the other "required" attributes, too!

This already works for resource spans (hat tip to @AbhiPrasad).

@AbhiPrasad
Copy link
Member

Released with https://github.com/getsentry/sentry-javascript/releases/tag/7.111.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants