diff --git a/.spi.yml b/.spi.yml index e343a14..9b30380 100644 --- a/.spi.yml +++ b/.spi.yml @@ -1,5 +1,5 @@ version: 1 builder: configs: - - documentation_targets: [GRPCHealthService, GRPCOTelTracingInterceptors] + - documentation_targets: [GRPCHealthService, GRPCInteropTests, GRPCReflectionService, GRPCOTelTracingInterceptors, GRPCServiceLifecycle] swift_version: 6.0 diff --git a/Sources/GRPCInteropTests/Documentation.docc/Documentation.md b/Sources/GRPCInteropTests/Documentation.docc/Documentation.md new file mode 100644 index 0000000..f6e5595 --- /dev/null +++ b/Sources/GRPCInteropTests/Documentation.docc/Documentation.md @@ -0,0 +1,6 @@ +# ``GRPCInteropTests`` + +This module contains implementations for gRPC interoperability tests. + +## Overview +You can find more information on gRPC interoperability tests by looking at [gRPC's Interoperability Test Case Description](https://github.com/grpc/grpc/blob/ed39aad1b2d0d5f8a6841da5a63285d434308e9a/doc/interop-test-descriptions.md). diff --git a/Sources/GRPCOTelTracingInterceptors/Documentation.docc/Documentation.md b/Sources/GRPCOTelTracingInterceptors/Documentation.docc/Documentation.md new file mode 100644 index 0000000..fe09368 --- /dev/null +++ b/Sources/GRPCOTelTracingInterceptors/Documentation.docc/Documentation.md @@ -0,0 +1,56 @@ +# ``GRPCOTelTracingInterceptors`` + +This module contains client and server tracing interceptors adhering to OpenTelemetry's +recommendations on tracing. + +## Overview + +You can read more on this topic at [OpenTelemetry's documentation](https://opentelemetry.io/docs). +Some relevant pages listing which attributes and events you can expect on your spans include: +- [RPC Spans](https://opentelemetry.io/docs/specs/semconv/rpc/rpc-spans) +- [gRPC conventions](https://opentelemetry.io/docs/specs/semconv/rpc/grpc) + +You can set up a client interceptor like so during your bootstrapping phase: + +```swift +// Create the client interceptor +let interceptor = ClientOTelTracingInterceptor( + serverHostname: "someserver.com", + networkTransportMethod: "tcp" +) + +// Add it as an interceptor when creating your client +let client = GRPCClient( + transport: transport, + interceptors: [interceptor] +) + +// Finally run your client +try await client.runConnections() +``` + +You can similarly add the server interceptor to your server like this: + +```swift +// Create the server interceptor +let interceptor = ServerOTelTracingInterceptor( + serverHostname: "someserver.com", + networkTransportMethod: "tcp" +) + +// Add it as an interceptor when creating your server +let server = GRPCServer( + transport: transport, + services: [TestService()], + interceptors: interceptor +) + +// Finally run your server +try await server.serve() +``` + +For more information, look at the documentation for: +- ``GRPCOTelTracingInterceptors/ClientOTelTracingInterceptor``, +- ``GRPCOTelTracingInterceptors/ServerOTelTracingInterceptor``, +- [Client Interceptors](https://swiftpackageindex.com/grpc/grpc-swift/documentation/grpccore/clientinterceptor), +- [Server Interceptors](https://swiftpackageindex.com/grpc/grpc-swift/documentation/grpccore/serverinterceptor) diff --git a/Sources/GRPCReflectionService/Documentation.docc/Documentation.md b/Sources/GRPCReflectionService/Documentation.docc/Documentation.md new file mode 100644 index 0000000..01e225b --- /dev/null +++ b/Sources/GRPCReflectionService/Documentation.docc/Documentation.md @@ -0,0 +1,8 @@ +# ``GRPCReflectionService`` + +This module contains an implementation of the gRPC Reflection service +("grpc.reflection.v1.ServerReflection"). + +## Overview + +The reflection service is a regular gRPC service providing information about other services. diff --git a/Sources/GRPCServiceLifecycle/Documentation.docc/Documentation.md b/Sources/GRPCServiceLifecycle/Documentation.docc/Documentation.md new file mode 100644 index 0000000..bb1409b --- /dev/null +++ b/Sources/GRPCServiceLifecycle/Documentation.docc/Documentation.md @@ -0,0 +1,8 @@ +# ``GRPCServiceLifecycle`` + +This module conforms `GRPCClient` and `GRPCServer` to the `Service` protocol of `SwiftServiceLifecycle`, +to allow for easy composition. + +## Overview + +For more information on `SwiftServiceLifecycle`, [see its documentation](https://swiftpackageindex.com/swift-server/swift-service-lifecycle/documentation/servicelifecycle).