Skip to content
Merged
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
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ By default, this should be accessible on your main serving port, at the `/metric
```swift
app.get("metrics") { req -> EventLoopFuture<String> in
let promise = req.eventLoop.makePromise(of: String.self)
try MetricsSystem.prometheus().collect(into: promise)
DispatchQueue.global().async {
do {
try MetricsSystem.prometheus().collect(into: promise)
} catch {
promise.fail(error)
}
}
return promise.futureResult
}
```
Expand Down