traceContext<T> function
- @Deprecated('Will be removed in v0.19.0. Use [trace] instead')
- @experimental
Records a span of the given name
for the given function with a given
api.Tracer and marks the span as errored if an exception occurs.
Implementation
@Deprecated('Will be removed in v0.19.0. Use [trace] instead')
@experimental
Future<T> traceContext<T>(String name, Future<T> Function(api.Context) fn,
{api.Context? context,
api.Tracer? tracer,
bool newRoot = false,
api.SpanKind spanKind = api.SpanKind.internal,
List<api.SpanLink> spanLinks = const []}) async {
return trace(name, () => fn(api.Context.current),
context: context,
tracer: tracer,
newRoot: newRoot,
spanKind: spanKind,
spanLinks: spanLinks);
}