GitHub user lulf opened a pull request:
https://github.com/apache/qpid-dispatch/pull/159
Metrics support
@ganeshmurthy @ted-ross This is a proposal of metrics in the router and
expose them to a prometheus agent.
This work would allow anyone running the router on openshift to easily
integrate it with hawkular or any other store that supports reading prometheus
endpoints.
The PR consists of:
* An API for a metric manager, that keeps track of all metrics in the
router, and that is able to export them (see metric_manager.h and
metric_manager.c)
* An API for a metric, used to increment/set values for a particular
metric, with labels (see metric.h, metric_private.h, metric.c)
* Integration with the http-libwebsockets for exposing the metrics in
prometheus format on http://host:httpport/metrics (http-libwebsockets.c)
* An example of a metric in router_core/connections.c when opening a
connection. (router_core/router_core.c, router_core/connections.c)
The libraries are written with the idea that incrementing a metric should
be as cheap as possible (though there are several optimizations to be made for
efficiently looking up labels). A metric is registered in the metric manager,
which will store it in its internal database. A handle to the metric
(num_connections for instance) is stored for efficient metric reporting. The
handle is used whenever the metric should be incremented, decremented or set.
The API also contains a set of macros that makes passing labels less
verbose.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/lulf/qpid-dispatch metrics
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/qpid-dispatch/pull/159.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #159
----
commit 03e0ebbdaf446199be42033b5ea63c654a89ddfc
Author: Ulf Lilleengen <[email protected]>
Date: 2017-03-31T11:30:13Z
Add data structures for tracking metrics
* Add num_connections metric as initial metric for testing
commit 2e3b688d1cc862c69632e8aa6256fa6e944a3b87
Author: Ulf Lilleengen <[email protected]>
Date: 2017-03-31T13:53:23Z
Add support for labels in the interface
commit e7659af42a23f72c4ffb73841f821668f827a7c3
Author: Ulf Lilleengen <[email protected]>
Date: 2017-03-31T14:23:48Z
Support reporting with labels
commit 0bbe0368cf7ee042c406401625a89f74f043e152
Author: Ulf Lilleengen <[email protected]>
Date: 2017-03-31T15:03:12Z
Pass some labels
commit 37a5e0b2d1d5ff8b40d84245a5cbfcb07e39df2a
Author: Ulf Lilleengen <[email protected]>
Date: 2017-04-06T08:59:52Z
Add metric manager for keeping track of metrics and exporting
commit 0cede49376a81f6c7904b3d29c056697ab94a20d
Author: Ulf Lilleengen <[email protected]>
Date: 2017-04-06T09:00:07Z
Expose metrics in http
commit 39cdaed1244d6dcae52e06d03f32bf303ae1995a
Author: Ulf Lilleengen <[email protected]>
Date: 2017-04-06T09:11:13Z
Free resources at shutdown
commit b259e244a98c528f9ddeee0da7179d2d490781dc
Author: Ulf Lilleengen <[email protected]>
Date: 2017-04-06T09:25:36Z
Initialize all memory
commit c847e9bc3a5f3731f33a6e88db514b4b60e1f6ae
Author: Ulf Lilleengen <[email protected]>
Date: 2017-04-06T09:33:35Z
Add dec with label
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]