traceContextSync<T> function
- @Deprecated('Will be removed in v0.19.0. Use [traceSync] instead')
- @experimental
Use traceContextSync instead of traceContext when fn is not an async
function.
Implementation
@Deprecated('Will be removed in v0.19.0. Use [traceSync] instead')
@experimental
T traceContextSync<T>(
String name,
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 [],
}) {
return traceSync(
name,
() => fn(api.Context.current),
context: context,
tracer: tracer,
newRoot: newRoot,
spanKind: spanKind,
spanLinks: spanLinks,
);
}