Go on :-)
Using the props map was just easier in hawkular-1259 but now we're at a
step where we can design a model more specific to prometheus.
Are all metric labels needed for inventory? Or is it just a subset?
There's also something that needs to be done to distinguish availability
metrics (I think Lucas was adding a "tag" field in the model, indexed,
allowing to query for metrics tagged "availability" ... Lucas do you
confirm?). Are we able to recognize avail metrics from the agent, or is it
something that must be hard-coded somewhere for explicit family name?
I fear that having both "tags" and "labels" on the model can be quite
confusing, but on the other hand we don't want to index all P labels in
ispn.
On Thu, Oct 26, 2017 at 11:48 PM, John Mazzitelli <mazz(a)redhat.com> wrote:
I *think* I'm almost at the point where our inventory is able to
store
Prometheus metric data (metric family name and labels) in our inventory.
Once done, you need only query inventory to get a resource's metric data
and from there you will get the Prometheus metric family+labels so you know
what you need to ask Prometheus for.
Currently, there is no place in our Metric domain object in inventory for
this information. Right now I am putting it in that generic properties:
// don't copy properties - we are using the inventory properties
for P labels right now
//m.getProperties().forEach((k, v) -> mb.property(k,
v.toString()));
// map to the Prometheus metric timeseries
mb.property("hawkular.metric.family", m.getMetricFamily());
mb.properties(m.getMetricLabels());
The object "m" is the agent's own Metric object that has a generic
properties map. Right now I don't think we store anything in there so that
commented portion of the code is no big deal at the moment.
But notice the metric family name and the metric labels are all in the
same generic properties for the inventory Metric object (that's what mb is).
I don't like this. It means who ever queries inventory has to strip out
the "hawkular.metric.family" key from the metric generic properties - the
rest of the map are the real labels.
I think we should make these first-class attributes in the inventory model:
mb.metricFamily(m.getMetricFamily())
mb.metricLabels(m.getMetricLabels())
Thoughts? (looking at you Joel :-)
[ps. this email was sent at 5:48pm on October 26, 2017]
_______________________________________________
hawkular-dev mailing list
hawkular-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hawkular-dev