Add grpc-swift-2 OTLP gRPC exporter behind the OTLPGRPCSwift2 trait #1306
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 318 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1306"
general
weight: 0.35
nachoBonafonte
Summary
Apps on grpc-swift-2 can't run the OTLP gRPC exporter next to their own gRPC code, and grpc-swift 1 is in maintenance mode. Add an exporter built on grpc-swift-2, as discussed in #729, on top of the traits from #1276, without breaking 3.0.0 users of the grpc-swift 1 exporter.
OTLPGRPCSwift2enables the newOpenTelemetryProtocolExporterGrpcSwift2product, built on grpc-swift-2. It needs iOS 18 / macOS 15.init(client:)shares aGRPCClientthe caller runs.init(transport:)creates, runs and stops its own client.logger:is gone, andconfig.compressionnow applies.OpenTelemetryProtocolExporterandOTLPGRPCstay on grpc-swift 1, as in 3.0.0. Its exporters are deprecated and point to the new product, so they can be removed in 4.0.OtlpTraceJsonExporterbuilds without traits.Examples/OTLP Exporteris unchanged.Examples/OTLP gRPC Swift 2 Exporterexports the same telemetry with grpc-swift-2, so you can compare the two.Testing
1. Run
swift test --enable-all-traits --filter "OpenTelemetryProtocolExporterTests|OpenTelemetryProtocolExporterGrpcSwift2Tests". Assert that every test passes, includingOtlpGrpcBlockingTests.2. In
Examples/OTLP Exporter, rundocker-compose up, then, from the repository root,swift run --traits OTLPGRPCSwift2 OTLPGRPCSwift2Exporter. Assert that the spans appear in Zipkin at <http://localhost:9411/zipkin/> and that the example exits cleanly.3. Run
Scripts/check-trait-pruning.shandScripts/check-trait-diagnostics.sh. Assert that both pass, which means each gRPC stack resolves only with its trait.Limitations
OtlpConfiguration, andOTEL_EXPORTER_OTLP_ENDPOINT, are left for later. Callers build the transport.exportblocks its caller. It runs on a private serial executor, so it can't deadlock a saturated cooperative pool, but that relies on undocumented libdispatch behavior. With a client you run yourself, this is true only if its connections run off the pool.grpc-swiftstays pinned to1.27.6.Checklist
swift test --enable-all-traitspasses locally, apart from five SDK and bridge tests that also fail onmainlocally and pass in CI