Skip to content

Commit 504476e

Browse files
code28MrLotU
authored andcommitted
Fix vapor example (#28)
1 parent 96cb1a3 commit 504476e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ Prometheus itself is designed to "pull" metrics from a destination. Following th
109109
By default, this should be accessible on your main serving port, at the `/metrics` endpoint. An example in [Vapor](https://vapor.codes) syntax looks like:
110110

111111
```swift
112-
router.get("/metrics") { request -> String in
113-
return myProm.collect()
112+
router.get("/metrics") { request -> EventLoopFuture<String> in
113+
let promise = request.eventLoop.newPromise(of: String.self)
114+
myProm.collect(into: promise)
115+
return promise.futureResult
114116
}
115117
```
116118

0 commit comments

Comments
 (0)