File tree Expand file tree Collapse file tree 2 files changed +238
-278
lines changed
Sources/GRPCInterceptors/Tracing
Tests/GRPCInterceptorsTests Expand file tree Collapse file tree 2 files changed +238
-278
lines changed Original file line number Diff line number Diff line change 1616
1717public import GRPCCore
1818internal import Synchronization
19- internal import Tracing
19+ package import Tracing
2020
2121/// A client interceptor that injects tracing information into the request.
2222///
@@ -66,9 +66,26 @@ public struct ClientOTelTracingInterceptor: ClientInterceptor {
6666 StreamingClientRequest < Input > ,
6767 ClientContext
6868 ) async throws -> StreamingClientResponse < Output >
69+ ) async throws -> StreamingClientResponse < Output > where Input: Sendable , Output: Sendable {
70+ try await self . intercept (
71+ tracer: InstrumentationSystem . tracer,
72+ request: request,
73+ context: context,
74+ next: next
75+ )
76+ }
77+
78+ /// Same as ``intercept(request:context:next:)``, but allows specifying a `Tracer` for testing purposes.
79+ package func intercept< Input, Output> (
80+ tracer: any Tracer ,
81+ request: StreamingClientRequest < Input > ,
82+ context: ClientContext ,
83+ next: (
84+ StreamingClientRequest < Input > ,
85+ ClientContext
86+ ) async throws -> StreamingClientResponse < Output >
6987 ) async throws -> StreamingClientResponse < Output > where Input: Sendable , Output: Sendable {
7088 var request = request
71- let tracer = InstrumentationSystem . tracer
7289 let serviceContext = ServiceContext . current ?? . topLevel
7390
7491 tracer. inject (
You can’t perform that action at this time.
0 commit comments