Description
Problem Statement
http.client
spans can have relative URLs. Relative URLs are tricky for a few reasons:
- 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 - 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).