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

Don't default the tracer name. #3153

Closed
wants to merge 1 commit into from

Conversation

jkwatson
Copy link
Contributor

And, make sure that the standard exporters can handle a null InstrumentationLibraryInfo name.

The spec changed in v1.2.0 to say we should no longer have a default: open-telemetry/opentelemetry-specification#1534

And, make sure that the standard exporters can handle a null InstrumentationLibraryInfo name.
@@ -48,6 +45,7 @@ public static InstrumentationLibraryInfo empty() {
*
* @return the name of the instrumentation library.
*/
@Nullable
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm - going from non-null to Nullable isn't technically a safe change, as can be seen with the amount of null checks we had to add everywhere (any custom exporter out there would have the same problem on a minor version bump). Since the spec says SHOULD preserve original value, but we know preserving null in Java is generally a bad idea, can we just skip this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a fine question. @bogdandrutu was the one who pushed for this in the specs. Opinions?

Honestly, I also think this is a bad change. I would much prefer to have a fallback name, so that exporters don't all have to guard against this case.

Can we maybe use empty string as the default, rather than keeping nulls?

Copy link
Contributor

Choose a reason for hiding this comment

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

Empty string is still a better default than keeping nulls indeed.

Copy link

Choose a reason for hiding this comment

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

I'd definitely vote against setting this nullable as the value will propagate, causing lots of extra null-checks (as documented in this PR).

Copy link
Contributor Author

@jkwatson jkwatson Apr 16, 2021

Choose a reason for hiding this comment

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

Please add your opinions to open-telemetry/opentelemetry-specification#1619 :)

Copy link

Choose a reason for hiding this comment

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

Added :)

@jkwatson
Copy link
Contributor Author

Turned this into a draft, pending the outcome of the related spec issue.

@jkwatson
Copy link
Contributor Author

closing, as we're going with #3170

@jkwatson jkwatson closed this Apr 28, 2021
@jkwatson jkwatson deleted the allow_null_ili_name branch April 28, 2021 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants