@@ -43,6 +43,13 @@ 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<String,String> and ByteBuffer are guaranteed to be supported,
49+ * otherwise only carriers that have been registered are supported.
50+ *
51+ * Attempting to inject to a carrier that has been registered/configured to this Tracer will result in a
52+ * IllegalStateException.
4653 */
4754 <T > void inject (Span span , T carrier );
4855
@@ -56,9 +63,16 @@ public interface Tracer {
5663 *
5764 * (Note that some OpenTracing implementations consider the Spans on either side of an RPC to have the same identity,
5865 * and others consider the caller to be the parent and the receiver to be the child)
66+ *
67+ * Attempting to join from a carrier that has been registered/configured to this Tracer will result in a
68+ * IllegalStateException.
69+ *
70+ * If the span serialized state is invalid (corrupt, wrong version, etc) inside the carrier this will result in a
71+ * IllegalArgumentException.
5972 */
6073 <T > SpanBuilder join (T carrier );
6174
75+
6276 interface SpanBuilder {
6377
6478 /** Specify the operationName.
@@ -73,12 +87,6 @@ interface SpanBuilder {
7387 */
7488 SpanBuilder withParent (Span parent );
7589
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-
8290 /** Same as {@link Span#setTag(String, String)}, but for the span being built. */
8391 SpanBuilder withTag (String key , String value );
8492
@@ -88,7 +96,13 @@ interface SpanBuilder {
8896 /** Same as {@link Span#setTag(String, String)}, but for the span being built. */
8997 SpanBuilder withTag (String key , Number value );
9098
99+ /** Specify a timestamp of when the Span was started, represented in microseconds since epoch. */
100+ SpanBuilder withStartTimestamp (long microseconds );
101+
91102 /** Returns the started Span. */
92103 Span start ();
104+
105+ /** Returns the Span, with a started timestamp (represented in microseconds) as specified. */
106+ Span start (long microseconds );
93107 }
94108}
0 commit comments