swift-server / swift-prometheus

Prometheus client library for Swift
https://swiftpackageindex.com/swift-server/swift-prometheus
Apache License 2.0
145 stars 30 forks source link

New Version 2.0 API #92

Closed fabianfett closed 1 year ago

fabianfett commented 1 year ago

Motivation

Swift Prometheus has been in development since 2018. The previous maintainer (@MrLotU) stepped down about a year ago. Since then @ktoso and @fabianfett have maintained the existing code base.

In order to improve performance in the Prometheus library, we want to replace the existing implementation with a new one for version 2.0. While we do this we also want to get the general API closer to what the prometheus project recommends in their Writing client libraries guide. This means that we will also start to enforce Prometheus rules. For example having two counter with the same name, but one with labels and one without, is illegal in the Prometheus format. Lastly we want to remove the SwiftNIO dependency that is not needed anymore.

I'm well aware that this is a very large PR that changes lots of moving things.

Changes

Performance difference

In simple testing scenarios:

Differences to Writing client libraries guide

Do we want to offer this API? With the current patch we could add this API later.

Andrewangeta commented 1 year ago

Looks nice! :shipit:

ktoso commented 1 year ago

Feel free to merge at will btw šŸ‘