Skip to content

Commit 10135f8

Browse files
bg451yurishkuro
authored andcommitted
Remove SpanData (open-telemetry#215)
* Removes references of spandata Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * initial stab at tracing spec Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * adds link and event timestamp Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * re-add whitespace to reduce diff size Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * typo fix Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * Adds OutOfBand flag to span options Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * specification/api-distributedcontext: fix typo (open-telemetry#236) contest -> context Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * Adds comment+link to Remove Out Of Band Support RFC Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * remove comment in doc Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * Remove work_in_progress dir (open-telemetry#225) Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * Move start timestamp above the possibly removed fields Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * Fix typo in FailedNotRetryable (open-telemetry#243) Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * Rename TraceOptions to TraceFlags to be w3c compatible (open-telemetry#234) * Rename TraceOptions to TraceFlags to be w3c compatible Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com> * Fix more TraceOptions and rename recorded with sampled Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com> Signed-off-by: Brandon Gonzalez <bg@lightstep.com> * Respond to comment
1 parent e212bf3 commit 10135f8

File tree

4 files changed

+18
-121
lines changed

4 files changed

+18
-121
lines changed

specification/api-resources.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ with closed source environments. API MUST allow for creation of `Resources` and
88
for associating them with telemetry.
99

1010
When used with distributed tracing, a resource can be associated with the
11-
[Tracer](api-tracing.md#tracer) or individual
12-
[SpanData](api-tracing.md#spandata). When associated with `Tracer`, all `Span`s
11+
[Tracer](api-tracing.md#tracer). When associated with `Tracer`, all `Span`s
1312
produced by this `Tracer` will automatically be associated with this `Resource`.
14-
When associated with the `SpanData` explicitly for out-of-band spans -
13+
When associated with a `Span` explicitly for out-of-band spans -
1514
`Resource` that is set on `Tracer` MUST be ignored. Note, that association of
1615
`Tracer` with the `Resource` will be done in SDK, not as API call.
1716

specification/api-tracing.md

+12-110
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Table of Contents
1515
* [GetCurrentSpan](#getcurrentspan)
1616
* [WithSpan](#withspan)
1717
* [SpanBuilder](#spanbuilder)
18-
* [RecordSpanData](#recordspandata)
1918
* [GetBinaryFormat](#getbinaryformat)
2019
* [GetHttpTextFormat](#gethttptextformat)
2120
* [SpanContext](#spancontext)
@@ -37,20 +36,6 @@ Table of Contents
3736
* [GetCanonicalCode](#getcanonicalcode)
3837
* [GetDescription](#getdescription)
3938
* [GetIsOk](#getisok)
40-
* [SpanData](#spandata)
41-
* [Constructing SpanData](#constructing-spandata)
42-
* [Getters](#getters)
43-
* [GetName](#getname)
44-
* [GetKind](#getkind)
45-
* [GetStartTimestamp](#getstarttimestamp)
46-
* [GetEndTimestamp](#getendtimestamp)
47-
* [GetContext](#getcontext)
48-
* [GetParentSpanId](#getparentspanid)
49-
* [GetResource](#getresource)
50-
* [GetAttributes](#getattributes)
51-
* [GetTimedEvents](#gettimedevents)
52-
* [GetLinks](#getlinks)
53-
* [GetStatus](#getstatus)
5439

5540
</details>
5641

@@ -59,8 +44,6 @@ Tracing API consist of a few main classes:
5944
- `Tracer` is used for all operations. See [Tracer](#tracer) section.
6045
- `Span` is a mutable object storing information about the current operation
6146
execution. See [Span](#span) section.
62-
- `SpanData` is an immutable object that is used to report out-of-band completed
63-
spans. See [SpanData](#spandata) section.
6447

6548
## Data types
6649
While languages and platforms have different ways of representing data,
@@ -240,6 +223,14 @@ empty by default:
240223
- `Attribute`s
241224
- `Link`s
242225
- `Event`s
226+
- `Start timestamp`
227+
228+
N.B.: There is an active RFC to remove [out of band span reporting](https://github.com/open-telemetry/oteps/pull/26)
229+
so the following items below may be removed soon.
230+
231+
- `Resource`
232+
- `SpanID`
233+
- `OutOfBand` to specify the span originated from out of band
243234

244235
Each span has zero or one parent span and zero or more child spans, which
245236
represent causally related operations. A tree of related spans comprises a
@@ -304,6 +295,7 @@ with the moment when they are added to the `Span`.
304295
An `Event` is defined by the following properties:
305296
- (Required) Name of the event.
306297
- (Optional) One or more `Attribute`.
298+
- (Optional) Timestamp for the event.
307299

308300
The `Event` SHOULD be an immutable type.
309301

@@ -375,7 +367,8 @@ with the `Span`).
375367
Call to `End` of a `Span` MUST not have any effects on child spans. Those may
376368
still be running and can be ended later.
377369

378-
There MUST be no parameter.
370+
Parameters:
371+
- (Optional) Timestamp to explicitly set the end timestamp
379372

380373
This API MUST be non-blocking.
381374

@@ -388,8 +381,7 @@ timestamps to the Span object:
388381
- The end time needs to be recorded when the operation is ended.
389382

390383
Start and end time as well as Event's timestamps MUST be recorded at a time of a
391-
calling of corresponding API and MUST not be passed as an argument. In order to
392-
record already completed span - [`SpanData`](#spandata) API HAVE TO be used.
384+
calling of corresponding API.
393385

394386
## Status
395387

@@ -473,93 +465,3 @@ Returns the description of this `Status`.
473465
### GetIsOk
474466

475467
Returns false if this `Status` represents an error, else returns true.
476-
477-
## SpanData
478-
479-
`SpanData` is an immutable and final class. All getters of `SpanData` are thread
480-
safe and can be called any number of times.
481-
482-
`API` MUST provide a way of [constructing `SpanData`](#constructing-spandata)
483-
that can be recorded using `Tracer` method `RecordSpanData`.
484-
485-
### Constructing SpanData
486-
487-
`SpanData` is an immutable object that can be constructed using the following
488-
arguments:
489-
490-
- `SpanContext` identifying this `SpanData`.
491-
- Parent's `SpanId`. All-zeroes `SpanId` or `null` MUST be assumed and
492-
interchangeable if `SpanData` has no parent.
493-
- `Resource` this SpanData is recorded for. If not specified - `Tracer`'s
494-
`Resource` will be used instead when the `RecordSpanData` called on the
495-
`Tracer`.
496-
- Name of this `SpanData`.
497-
- `Kind` of this `SpanData`. `SpanKind.Internal` MUST be assumed as a default.
498-
- Start and End timestamps.
499-
- Set of attributes with the string key and the value, which must be either a
500-
string, a boolean value, or a numeric type.
501-
- Set of `Events`.
502-
- Set of `Links`.
503-
- `Status` of `SpanData` execution.
504-
505-
All collections passes as an argument MUST be either immutable if language
506-
allows it or copied so the change of the collection will not mutate the
507-
`SpanData`.
508-
509-
### Getters
510-
511-
Getters will be called by exporters in SDK. Implementation MUST not assume that
512-
getters will be called only once or at all. There also MUST be no expectations
513-
on how soon getters will be called after object creation.
514-
515-
#### GetName
516-
517-
Returns the name of this `SpanData`.
518-
519-
#### GetKind
520-
521-
Returns the `SpanKind` of this `SpanData`.
522-
523-
#### GetStartTimestamp
524-
525-
Returns the start timestamp of this `SpanData`.
526-
527-
#### GetEndTimestamp
528-
529-
Returns the end timestamp of this `SpanData`.
530-
531-
#### GetContext
532-
533-
Returns the `SpanContext` associated with this `SpanData`.
534-
535-
#### GetParentSpanId
536-
537-
Returns the `SpanId` of the parent of this `SpanData`.
538-
539-
#### GetResource
540-
541-
Returns the `Resource` associated with this `SpanData`. When `null` is returned
542-
the assumption is that `Resource` will be taken from the `Tracer` that is used
543-
to record this `SpanData`.
544-
545-
#### GetAttributes
546-
547-
Returns the `Attributes` collection associated with this `SpanData`. The order
548-
of attributes in collection is not significant. The typical use of attributes
549-
collection is enumeration so the fast access to the label value by it's key is
550-
not a requirement. This collection MUST be immutable.
551-
552-
#### GetTimedEvents
553-
554-
Return the collection of `Events` with the timestamps associated with this
555-
`SpanData`. The order of events in collection is not guaranteed. This collection
556-
MUST be immutable.
557-
558-
#### GetLinks
559-
560-
Returns the `Links` collection associated with this `SpanData`. The order of
561-
links in collection is not significant. This collection MUST be immutable.
562-
563-
#### GetStatus
564-
565-
Returns the `Status` of this `SpanData`.

specification/concurrency.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@
33
For languages which support concurrent execution the OpenTelemetry APIs provide
44
specific guarantees and safeties. Not all of API functions are safe to
55
be called concurrently. Function and method documentation must explicitly
6-
specify whether it is safe or no to make concurrent calls and in what
6+
specify whether it is safe or no to make concurrent calls and in what
77
situations.
88

99
The following are general recommendations of concurrent call safety of
1010
specific subsets of the API.
1111

1212
**Tracer** - all methods are safe to be called concurrently.
1313

14-
**SpanBuilder** - It is not safe to concurrently call any methods of the
15-
same SpanBuilder instance. Different instances of SpanBuilder can be safely
14+
**SpanBuilder** - It is not safe to concurrently call any methods of the
15+
same SpanBuilder instance. Different instances of SpanBuilder can be safely
1616
used concurrently by different threads/coroutines, provided that no single
1717
SpanBuilder is used by more than one thread/coroutine.
1818

19-
**Span** - All methods of Span are safe to be called concurrently.
20-
21-
**SpanData** - SpanData is immutable and is safe to be used concurrently.
19+
**Span** - All methods of Span are safe to be called concurrently.
2220

2321
**Link** - same as SpanData.

specification/library-layout.md

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ This API consist of a few main classes:
3434
- `Tracer` is used for all operations. See [Tracer](api-tracing.md#tracer) section.
3535
- `Span` is a mutable object storing information about the current operation
3636
execution. See [Span](api-tracing.md#span) section.
37-
- `SpanData` is an immutable object that is used to report out-of-band completed
38-
spans. See [SpanData](api-tracing.md#spandata) section.
3937

4038
### `/internal` (_Optional_)
4139
Private application and library code.

0 commit comments

Comments
 (0)