@@ -27,24 +27,9 @@ import { SpanOptions } from './SpanOptions';
27
27
*/
28
28
export interface Tracer {
29
29
/**
30
- * Returns the current Span from the current context if available .
30
+ * Starts a new { @link Span}. Start the span without setting it on context .
31
31
*
32
- * If there is no Span associated with the current context, `undefined` is
33
- * returned.
34
- *
35
- * To install a {@link Span} to the current Context use
36
- * {@link Tracer.withSpan}.
37
- *
38
- * @returns Span The currently active Span
39
- */
40
- getCurrentSpan ( ) : Span | undefined ;
41
-
42
- /**
43
- * Starts a new {@link Span}. Start the span without setting it as the current
44
- * span in this tracer's context.
45
- *
46
- * This method do NOT modify the current Context. To install a {@link
47
- * Span} to the current Context use {@link Tracer.withSpan}.
32
+ * This method do NOT modify the current Context.
48
33
*
49
34
* @param name The name of the span
50
35
* @param [options] SpanOptions used for span creation
@@ -56,32 +41,4 @@ export interface Tracer {
56
41
* span.end();
57
42
*/
58
43
startSpan ( name : string , options ?: SpanOptions , context ?: Context ) : Span ;
59
-
60
- /**
61
- * Executes the function given by fn within the context provided by Span.
62
- *
63
- * This is a convenience method for creating spans attached to the tracer's
64
- * context. Applications that need more control over the span lifetime should
65
- * use {@link Tracer.startSpan} instead.
66
- *
67
- * @param span The span that provides the context
68
- * @param fn The function to be executed inside the provided context
69
- * @example
70
- * tracer.withSpan(span, () => {
71
- * tracer.getCurrentSpan().addEvent("parent's event");
72
- * doSomeOtherWork(); // Here "span" is the current Span.
73
- * });
74
- */
75
- withSpan < T extends ( ...args : unknown [ ] ) => ReturnType < T > > (
76
- span : Span ,
77
- fn : T
78
- ) : ReturnType < T > ;
79
-
80
- /**
81
- * Bind a span as the target's context or propagate the current one.
82
- *
83
- * @param target Any object to which a context need to be set
84
- * @param [context] Optionally specify the context which you want to bind
85
- */
86
- bind < T > ( target : T , context ?: Span ) : T ;
87
44
}
0 commit comments