You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Tracing/Tracer.swift
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -150,5 +150,36 @@ extension Tracer {
150
150
throw error // rethrow
151
151
}
152
152
}
153
+
154
+
/// Execute the given async operation within a newly created `Span`,
155
+
/// started as a child of the passed in `Baggage` or as a root span if `nil`.
156
+
///
157
+
/// DO NOT `end()` the passed in span manually. It will be ended automatically when the `operation` returns.
158
+
///
159
+
/// - Parameters:
160
+
/// - operationName: The name of the operation being traced. This may be a handler function, database call, ...
161
+
/// - baggage: The baggage to be used for the newly created span. It may be obtained by the user manually from the `Baggage.current`,
162
+
// task local and modified before passing into this function. The baggage will be made the current task-local baggage for the duration of the `operation`.
163
+
/// - kind: The `SpanKind` of the `Span` to be created. Defaults to `.internal`.
164
+
/// - operation: operation to wrap in a span start/end and execute immediately
165
+
/// - Returns: the value returned by `operation`
166
+
/// - Throws: the error the `operation` has thrown (if any)
0 commit comments