UNPKG

1.26 kBTypeScriptView Raw
1import { Context } from '../context/types';
2import { Span } from './span';
3import { SpanContext } from './span_context';
4/**
5 * Return the span if one exists
6 *
7 * @param context context to get span from
8 */
9export declare function getSpan(context: Context): Span | undefined;
10/**
11 * Gets the span from the current context, if one exists.
12 */
13export declare function getActiveSpan(): Span | undefined;
14/**
15 * Set the span on a context
16 *
17 * @param context context to use as parent
18 * @param span span to set active
19 */
20export declare function setSpan(context: Context, span: Span): Context;
21/**
22 * Remove current span stored in the context
23 *
24 * @param context context to delete span from
25 */
26export declare function deleteSpan(context: Context): Context;
27/**
28 * Wrap span context in a NoopSpan and set as span in a new
29 * context
30 *
31 * @param context context to set active span on
32 * @param spanContext span context to be wrapped
33 */
34export declare function setSpanContext(context: Context, spanContext: SpanContext): Context;
35/**
36 * Get the span context of the span if it exists.
37 *
38 * @param context context to get values from
39 */
40export declare function getSpanContext(context: Context): SpanContext | undefined;
41//# sourceMappingURL=context-utils.d.ts.map
\No newline at end of file