Added Prometheus PushGateway support #72
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added support for the prometheus pushgateway.
Checklist
Motivation and Context
I needed a swift library, which would allow me to upload metrics to the pushgateway. I developed this solution and decided to suggest it as an improvement to the SwiftPrometheus library, as mentioned in #47.
Description
I did not change any of the existing functionalities, rather I added new ones. I added a repeating timer class, which allows for a process to be repeatedly triggered in the background. In addition to that I added two public functions to the Prometheus client, one for setting up the repeated pushes and one for tearing them down. There are two additional private helper functions, which should make the code easier to follow through.
I ran the available tests locally and also experimented with the framework in a personal project.
Once I receive confirmation that such a change is something that is welcome to this project, I will be more than happy to add additional tests and documentation.
There is a lot of code and I am open for improvements/ suggestions. I would be more than happy to contribute to this project!