Added metrics framework and implementation #910
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.
Release notes
[feature] Added metrics framework and Prometheus implementation.
- Enable by setting
metrics_provider_class
toMetricsProviderPrometheus
.- Metrics endpoint can be found on http://localhost:9400/metrics by default.
- port can be changed with
metrics_endpoint_port
. Set to 0 to disable http endpoint.What does this PR do?
To gain insights into the state of running software, the software can expose metrics, which are then gathered by a metrics framework.
A popular framework for this is Prometheus, but there are others.
This PR adds the ability for Moquette to expose metrics for such system to gather, and provides an implementation for Prometheus specifically.
By default, metrics are not gathered, and the system is only a shim that has minimal impact on performance. The Proteus implementation is a separate project that can be added to the classpath if desired. This minimises the impact for users that do not require metrics and does not change any dependencies for those use-cases.
I have made corresponding change to the default configuration files (and/or docker env variables)How to test this PR locally
metrics_provider_class=MetricsProviderPrometheus