Server-Side Swift example application
This repo contains an example that showcases various aspects of the Server-Side Swift ecosystem.
It’s a microservices-oriented set of APIs, instrumented using Logging,
Metrics,
and Distributed Tracing.
Each service is contained in its own Swift package, located under /services/<service-name>
.
Traces are exported to an OpenTelemetry Collector running in a Docker container, and visualized via Jaeger.
Both of these containers may be started through docker-compose.yaml
:
docker-compose up -d
This example makes use of yet to be release Swift features such as async/await and task locals.
Therefore you’ll need to have the latest development snapshot of Swift installed on a Mac.
You also need to specify the DYLD_LIBRARY_PATH
to be able to run the executables:
export DYLD_LIBRARY_PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/lib/swift/macosx
To run the Storage
service, build and execute storagectl
:
cd services/storage
swift build && ./.build/debug/storagectl serve --log-level trace