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

Consider reverting/amending #1534 (removes fallback tracer name) #1619

Closed
jkwatson opened this issue Apr 15, 2021 · 5 comments · Fixed by #1654
Closed

Consider reverting/amending #1534 (removes fallback tracer name) #1619

jkwatson opened this issue Apr 15, 2021 · 5 comments · Fixed by #1654
Assignees
Labels
area:api Cross language API specification issue spec:trace Related to the specification/trace directory

Comments

@jkwatson
Copy link
Contributor

#1534 changed the spec to require null tracer names to be kept intact. Unfortunately, this ends up introducing a pretty significant behavioral breaking change to the Java SDK interfaces for exporters. It would require our InstrumentationLibraryInfo to return a nullable name attribute, which means that all exporters (both ours and any 3rd party) now have to guard against a null attribute, or risk throwing NullPointerExceptions in the exporter.

See this Java PR for the impact within the java repository itself: open-telemetry/opentelemetry-java#3153

I think that we should amend this part of the specification to note that nulls should be converted into empty strings, or we should revert that change and specify an actual fallback value.

@reyang reyang added area:api Cross language API specification issue spec:trace Related to the specification/trace directory labels Apr 16, 2021
@Oberon00
Copy link
Member

The requirement in question is a SHOULD-requirement. So if Java has good reasons to deviate (slightly), I think it is fine to do so with the current spec.

@tedsuo
Copy link
Contributor

tedsuo commented Apr 16, 2021

It looks like this issue is caused by an unnecessary side effect in the PR. The original issue was to define a canonical tracer name when an invalid name is given. Returning the original invalid name of the tracer seems like incorrect behavior - we should return the default name, and log the error.

@carlosalberto
Copy link
Contributor

cc @bogdandrutu

@ghost
Copy link

ghost commented Apr 19, 2021

Reading the spec (In case an invalid name (null or empty string)) I believe that what we can do in Java, in order to avoid all of the extra null-checks is:

  • check if the name is valid (non-empty string)
  • if it's null, use an empty string (as a fallback)
    This way both backend will be aware that the name provided was invalid and the code won't need to be null-protected.

@carlosalberto
Copy link
Contributor

After discussing it in today's SIG call, we decided to go with an empty string instead of null and log the error. Assigning this issue to me, and will present a PR with the aforementioned changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Cross language API specification issue spec:trace Related to the specification/trace directory
Projects
None yet
5 participants