-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Redefine ExportSpans of SpanExporter with ReadOnlySpan #1873
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is not required by the specification nor the use of this interface.
Use this type to encapsulate the Span status similar to the Event type encapsulating a Span event
A read-only span value does not need to know if updates to it will be recorded. It by definition cannot be updated so no point in communicating if an update would be recorded.
Add the DroppedAttributes, DroppedLinks, DroppedEvents, and ChildSpanCount methods to the interface to return additional information about the span not specified by the specification, but that we are already providing.
This method is a hold-over from previous version of the ReadOnlySpan interface is not needed.
Codecov Report
@@ Coverage Diff @@
## main #1873 +/- ##
=======================================
- Coverage 79.0% 79.0% -0.1%
=======================================
Files 137 139 +2
Lines 7384 7477 +93
=======================================
+ Hits 5837 5909 +72
- Misses 1301 1322 +21
Partials 246 246
|
Merged
jmacd
approved these changes
May 3, 2021
I really read it. :) |
MrAlias
added
area:trace
Part of OpenTelemetry tracing
pkg:SDK
Related to an SDK package
labels
May 3, 2021
MrAlias
requested review from
Aneurysm9,
dashpole,
evantorrie,
paivagustavo and
XSAM
as code owners
May 3, 2021 19:37
Aneurysm9
approved these changes
May 4, 2021
paivagustavo
approved these changes
May 4, 2021
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates the
SpanExporter
interface to acceptReadOnlySpan
s instead ofSpanSnapshot
s. This includes the following changes:SpanStub
type and its associated functions were added to thego.opentelemetry.io/otel/sdk/trace/tracetest
package. This type can be used as a testing replacement for theSpanSnapshot
that was removed from thego.opentelemetry.io/otel/sdk/trace
package.ExportSpans
method of theSpanExporter
interface type was updated to acceptReadOnlySpan
s instead of the removedSpanSnapshot
. This brings the export interface into compliance with the specification in that it now accepts an explicitly immutable type instead of just an implied one.Tracer
andIsRecording
method from theReadOnlySpan
in thego.opentelemetry.io/otel/sdk/trace
. TheTracer
method is not a required to be included in this interface and given the mutable nature of the tracer that is associated with a span, this method is not appropriate. TheIsRecording
method returns if the span is recording or not. A read-only span value does not need to know if updates to it will be recorded or not. By definition, it cannot be updated so there is no point in communicating if an update is recorded.SpanSnapshot
type from thego.opentelemetry.io/otel/sdk/trace
package. The use of this type has been replaced with the use of the explicitly immutableReadOnlySpan
type. When a concrete representation of a read-only span is needed for testing, the newly addedSpanStub
in thego.opentelemetry.io/otel/sdk/trace/tracetest
package should be used.*messageEvent*
names to just be*Event*
.Resolves #1380