Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .spi.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 1
builder:
configs:
- documentation_targets: [GRPCHealthService, GRPCOTelTracingInterceptors]
- documentation_targets: [GRPCHealthService, GRPCInteropTests, GRPCReflectionService, GRPCOTelTracingInterceptors, GRPCServiceLifecycle]
swift_version: 6.0
6 changes: 6 additions & 0 deletions Sources/GRPCInteropTests/Documentation.docc/Documentation.md
Original file line number Diff line number Diff line change
@@ -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).
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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).
Loading