Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 3056c7b

Browse files
addressing comments in #13
1 parent fd5564d commit 3056c7b

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

opentracing/src/main/java/opentracing/Span.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
package opentracing;
1515

1616
/**
17-
* Span represents an active, un-finished span in the opentracing system.
17+
* Represents an in-flight span in the opentracing system.
1818
*
19-
* <p>Spans are created by the {@link Tracer} interface.
19+
* <p>Spans are created by the {@link Tracer#buildSpan} interface.
2020
*/
2121
public interface Span {
2222

@@ -31,11 +31,6 @@ public interface Span {
3131
/**
3232
* Set a key:value tag on the Span.
3333
*
34-
* <p>Tag values can be of arbitrary types, however the treatment of complex types is dependent on
35-
* the underlying tracing system implementation. It is expected that most tracing systems will
36-
* handle primitive types like strings and numbers. If a tracing system cannot understand how to
37-
* handle a particular value type, it may ignore the tag, but shall not panic.
38-
*
3934
* <p>If there is a pre-existing tag set for {@code key}, it is overwritten.
4035
*/
4136
// overloaded 3x to support the BasicType concern
@@ -54,10 +49,13 @@ public interface Span {
5449
*/
5550
Span setBaggageItem(String key, String value);
5651

57-
/** Get a Baggage item by key. */
52+
/** Get a Baggage item by key.
53+
*
54+
* Returns null if no entry found, or baggage is not supported in the current implementation.
55+
*/
5856
String getBaggageItem(String key);
5957

60-
/** *
58+
/**
6159
* Add a new log event to the Span, accepting an event name string and an optional structured payload argument.
6260
* If specified, the payload argument may be of any type and arbitrary size,
6361
* though implementations are not required to retain all payload arguments
@@ -76,5 +74,5 @@ public interface Span {
7674
* The timestamp is specified manually here to represent a past log event.
7775
* The timestamp in microseconds in UTC time.
7876
**/
79-
Span log(long instantMicroseconds, String eventName, /* @Nullable */ Object payload);
77+
Span log(long timestampMicroseconds, String eventName, /* @Nullable */ Object payload);
8078
}

opentracing/src/main/java/opentracing/Tracer.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public interface Tracer {
4343
* a Span instance, and
4444
* a “carrier” object in which to inject that Span for cross-process propagation.
4545
*
46+
* A “carrier” object is some sort of http or rpc envelope, for example HeaderGroup (from Apache HttpComponents).
47+
*
48+
* The low-level format carriers Map&lt;String,String> and ByteBuffer are guaranteed to be supported,
49+
* otherwise only carriers that have been registered are supported.
4650
*/
4751
<T> void inject(Span span, T carrier);
4852

@@ -73,12 +77,6 @@ interface SpanBuilder {
7377
*/
7478
SpanBuilder withParent(Span parent);
7579

76-
/** Specify a timestamp the Span actually started from.
77-
*
78-
* If the timestamp has already been set an IllegalStateException will be thrown.
79-
*/
80-
SpanBuilder withTimestamp(long microseconds);
81-
8280
/** Same as {@link Span#setTag(String, String)}, but for the span being built. */
8381
SpanBuilder withTag(String key, String value);
8482

@@ -90,5 +88,8 @@ interface SpanBuilder {
9088

9189
/** Returns the started Span. */
9290
Span start();
91+
92+
/** Returns the Span, with a started timestamp (represented in microseconds) as specified. */
93+
Span start(long microseconds);
9394
}
9495
}

0 commit comments

Comments
 (0)