opentelemetry-ruby
opentelemetry-ruby copied to clipboard
fix: Omit `nil` `net.peer.name` attributes
Faraday uses a base URL to derive the host name which is used by the tracer middleware as the span attribute value for net.peer.name
.
Although it seems incorrect, Faraday does not require a base URL when it is initialized and is a commonly used when using Faraday test stubs.
When the base URL is absent, the net.peer.name
is set to nil
triggering and invalid attribute error report and creates a bit of noise for test cases.
This change omits the net.peer.name
attribute when it is nil
to suppress error reporting when the host is absent.
Going to add additional tests where net.peer.name
should be omitted if the URL contains an IP address instead of a hostname. Per our discussion during the SIG today
Turns out Ruby stdlib URI will return the IP Addr as the host value so it won't be as simple as I thought.
I am going to table this PR and come back to it later.
Hello, and thank you for your contribution!
We recently split Ruby instrumentation out into the opentelemetry-ruby-contrib
repo.
This PR is related to instrumentation, so we'll need you to re-open it against opentelemetry-ruby-contrib
. Sorry for the inconvenience!
To do that, you can:
-
Create a fork of
opentelemetry-ruby-contrib
and copy the git url - In your
opentelemetry-ruby
repo, rungit remote add tmp-contrib <your-fork-git-url>
-
git push tmp-contrib your-branch-name
- Open a new PR in contrib (feel free to just copy/paste your original PR description there)
- Close your open PR in this repo with a comment that links to your new PR in contrib
- Delete your
tmp-contrib
remote fromopentelemetry-ruby
(git remote rm tmp-contrib
) -
git clone
youropentelemetry-ruby-contrib
fork, check out your branch, and make all changes in that repo from now on!
Sorry again for the inconvenience, and thank you for contributing!