@@ -25,34 +25,24 @@ import { SpanContext } from './span_context';
25
25
* @todo : Move into module of its own
26
26
*/
27
27
export interface SpanOptions {
28
- /**
29
- * The SpanKind of a span
30
- */
28
+ /** The SpanKind of a span */
31
29
kind ?: SpanKind ;
32
-
33
- /**
34
- * A spans attributes
35
- */
30
+ /** A spans attributes */
36
31
attributes ?: Attributes ;
37
-
38
- /**
39
- * Indicates that events are being recorded for a span
40
- */
32
+ /** Indicates that events are being recorded for a span */
41
33
isRecordingEvents ?: boolean ;
42
-
43
- /**
44
- * The parent span
45
- */
34
+ /** The parent span */
46
35
parent ?: Span | SpanContext ;
47
-
48
- /**
49
- * The start timestamp of a span
50
- */
36
+ /** The start timestamp of a span */
51
37
startTime ?: number ;
52
38
}
53
39
54
40
/**
55
- * Tracer provides an interface for creating spans and propagating context in-process.
41
+ * Tracer provides an interface for creating {@link Span}s and propagating
42
+ * context in-process.
43
+ *
44
+ * Users may choose to use manual or automatic Context propagation. Because of
45
+ * that this class offers APIs to facilitate both usages.
56
46
*/
57
47
export interface Tracer {
58
48
/**
@@ -66,12 +56,12 @@ export interface Tracer {
66
56
getCurrentSpan ( ) : Span ;
67
57
68
58
/**
69
- *
59
+ * Starts a new { @link Span}.
70
60
* @param name The name of the span
71
61
* @param [options] SpanOptions used for span creation
72
62
* @returns Span The newly created span
73
63
*/
74
- start ( name : string , options ?: SpanOptions ) : Span ;
64
+ startSpan ( name : string , options ?: SpanOptions ) : Span ;
75
65
76
66
/**
77
67
* Executes the function given by fn within the context provided by Span
@@ -91,20 +81,32 @@ export interface Tracer {
91
81
*
92
82
* @todo : Pending API discussion. Revisit if Span or SpanData should be passed
93
83
* in here once this is sorted out.
94
- * @param span
84
+ * @param span Span Data to be reported to all exporters.
95
85
*/
96
86
recordSpanData ( span : Span ) : void ;
97
87
98
88
/**
99
- * Returns the binary format interface which can serialize/deserialize Spans.
89
+ * Returns the {@link BinaryFormat} interface which can serialize/deserialize
90
+ * Spans.
91
+ *
92
+ * If no tracer implementation is provided, this defaults to the W3C Trace
93
+ * Context binary format ({@link BinaryFormat}). For more details see
94
+ * <a href="https://w3c.github.io/trace-context-binary/">W3C Trace Context
95
+ * binary protocol</a>.
96
+ *
100
97
* @todo : Change return type once BinaryFormat is available
101
98
*/
102
99
getBinaryFormat ( ) : unknown ;
103
100
104
101
/**
105
- * Returns the HTTP text format interface which can inject/extract Spans.
102
+ * Returns the {@link HttpTextFormat} interface which can inject/extract
103
+ * Spans.
104
+ *
105
+ * If no tracer implementation is provided, this defaults to the W3C Trace
106
+ * Context HTTP text format ({@link HttpTraceContext}). For more details see
107
+ * <a href="https://w3c.github.io/trace-context/">W3C Trace Context</a>.
106
108
*
107
109
* @todo : Change return type once HttpTextFormat is available
108
110
*/
109
- getHttpTextFormat : unknown ;
111
+ getHttpTextFormat ( ) : unknown ;
110
112
}
0 commit comments