-
Notifications
You must be signed in to change notification settings - Fork 893
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
Should span creation operations raise exceptions? #141
Comments
does this document looks good to be moved to spec? https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/docs/error-handling.md I'm happy to generalize it |
That looks great, especially
We still need to decide whether span creation should use a default name instead of raising an error though. If we do this in the python client we'll break with the java impl now, so we need to either mention this in the spec or decide that it's up to each language API to define defaults like this. |
* Update configuration.md Soften the normative requirement for all code to support environment variables to a recommendation. RUM libraries are already documented and specified to not support this configuration method, therefore there exist valid reasons why this part of the specification will not be implementable and should be a recommendation. * Update with conditional requirement
From open-telemetry/opentelemetry-python#11 (review).
The java tracer API docs note that calling
spanBuilder
with a nullspanName
arg should raise aNullPointerException
.NoopSpanBuilder
does this, butSpanBuilderSdk
doesn't.Two questions here:
Should we create a span with a default name (as @reyang and @carlosalberto suggest) instead of raising if the span name is null here? If we want to avoid exceptions in the API altogether this suggests we should also create a blank span current if the user calls
Tracer.withSpan
with a nullspan
, but this seems less defensible than using a default name.More generally, which errors should implementations raise? I could imagine letting the implementation be either more or less restrictive than the API, but if it can both raise exceptions that aren't listed in the API and choose not to raise exceptions that are... then there doesn't seem to be much point to listing exceptions in the API.
The text was updated successfully, but these errors were encountered: