Swiftpack.co - Apodini/ApodiniObservePrometheus as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Apodini.
Apodini/ApodiniObservePrometheus 0.1.4
Prometheus metrics configuration and types for the ApodiniObserve module
⭐️ 0
🕓 10 weeks ago
.package(url: "https://github.com/Apodini/ApodiniObservePrometheus.git", from: "0.1.4")


Build codecov

ApodiniObservePrometheus is a Apodini extension that drastically simplifies the configuration process for using the common Prometheus software stack with ApodiniObserve.


To use ApodiniObservePrometheus, you have to add it as a Swift Package dependency to your web service package. As ApodiniObservePrometheus is extending Apodini it also currently uses 0.x releases and every minor version number increment could include breaking changes. Therefore using .upToNextMinor(from: "0.0.0") is advised:

dependencies: [
    .package(url: "https://github.com/Apodini/ApodiniObservePrometheus.git", .upToNextMinor(from: "0.0.0"))

Next, add ApodiniObservePrometheus as a target dependency to your web service target:

targets: [
        name: "WebService",
        dependencies: [
            .product(name: "Apodini", package: "Apodini"),
            .product(name: "ApodiniObserve", package: "Apodini"),
            .product(name: "ApodiniObservePrometheus", package: "ApodiniObservePrometheus")


You can use ApodiniObservePrometheus as follows:

import Apodini
import ApodiniObserve
import ApodiniObservePrometheus

struct ExampleWebService: WebService {
    var content: some Component {
        // ...
    var configuration: Configuration {
        // ...

        // Setup of ApodiniMetrics with a PrometheusMetricsHandler backend
            handlerConfiguration: MetricPullHandlerConfiguration.defaultPrometheus,
            systemMetricsConfiguration: .default


Contributions to this project are welcome. Please make sure to read the contribution guidelines and the contributor covenant code of conduct first.


This project is licensed under the MIT License. See Licenses for more information.


Stars: 0
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

10 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics