Skip to content

Commit bbf98bd

Browse files
committed
Clarify the docs for observability
1 parent b30b5ed commit bbf98bd

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

Sources/Hummingbird/Middleware/LogRequestMiddleware.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
import HTTPTypes
1616
import Logging
1717

18-
/// Middleware outputting to log for every call to server
18+
/// Middleware outputting to log for every call to server.
19+
///
20+
/// Uses [Swift-Log](https://github.com/apple/swift-log) for logging the output.
21+
/// Swift-Log has a flexible backend, and will output to console by default.
22+
/// You can replace the Logging backend with other implementations.
23+
/// A list of implementations is available in the swift-log repository's README.
1924
public struct LogRequestsMiddleware<Context: RequestContext>: RouterMiddleware {
2025
/// Header filter
2126
public struct HeaderFilter: Sendable, ExpressibleByArrayLiteral {

Sources/Hummingbird/Middleware/MetricsMiddleware.swift

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ import Metrics
1919
///
2020
/// Records the number of requests, the request duration and how many errors were thrown. Each metric has additional
2121
/// dimensions URI and method.
22+
///
23+
/// Uses [Swift-Metrics](https://github.com/apple/swift-metrics) for recording the metrics.
24+
/// Swift-Metrics has a flexible backend, which will need to be initialized before any metrics are recorded.
25+
///
26+
/// A list of implementations is available in the swift-log repository's README.
2227
public struct MetricsMiddleware<Context: RequestContext>: RouterMiddleware {
2328
public init() {}
2429

Sources/Hummingbird/Middleware/TracingMiddleware.swift

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ import Tracing
2323
///
2424
/// You may opt in to recording a specific subset of HTTP request/response header values by passing
2525
/// a set of header names.
26+
///
27+
/// Uses [Swift-Distributed-Tracing](https://github.com/apple/swift-distributed-tracing) for recording the traces.
28+
/// Swift-Distributed-Tracing has a flexible backend, which will need to be initialized before any traces are recorded.
29+
///
30+
/// A list of implementations is available in the swift-distributed-tracing repository's README.
2631
public struct TracingMiddleware<Context: RequestContext>: RouterMiddleware {
2732
private let headerNamesToRecord: Set<RecordingHeader>
2833
private let attributes: SpanAttributes?

0 commit comments

Comments
 (0)