@@ -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+ * Attempting to inject to a carrier that has been registered/configured to this Tracer will result in a
49+ * IllegalStateException.
4650 */
4751 <T > void inject (Span span , T carrier );
4852
@@ -56,9 +60,16 @@ public interface Tracer {
5660 *
5761 * (Note that some OpenTracing implementations consider the Spans on either side of an RPC to have the same identity,
5862 * and others consider the caller to be the parent and the receiver to be the child)
63+ *
64+ * Attempting to join from a carrier that has been registered/configured to this Tracer will result in a
65+ * IllegalStateException.
66+ *
67+ * If the span serialized state is invalid (corrupt, wrong version, etc) inside the carrier this will result in a
68+ * IllegalArgumentException.
5969 */
6070 <T > SpanBuilder join (T carrier );
6171
72+
6273 interface SpanBuilder {
6374
6475 /** Specify the operationName.
@@ -73,12 +84,6 @@ interface SpanBuilder {
7384 */
7485 SpanBuilder withParent (Span parent );
7586
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-
8287 /** Same as {@link Span#setTag(String, String)}, but for the span being built. */
8388 SpanBuilder withTag (String key , String value );
8489
@@ -88,7 +93,13 @@ interface SpanBuilder {
8893 /** Same as {@link Span#setTag(String, String)}, but for the span being built. */
8994 SpanBuilder withTag (String key , Number value );
9095
96+ /** Specify a timestamp of when the Span was started, represented in microseconds since epoch. */
97+ SpanBuilder withStartTimestamp (long microseconds );
98+
9199 /** Returns the started Span. */
92100 Span start ();
101+
102+ /** Returns the Span, with a started timestamp (represented in microseconds) as specified. */
103+ Span start (long microseconds );
93104 }
94105}
0 commit comments