<div dir="ltr">Go on :-)<div><br></div><div>Using the props map was just easier in hawkular-1259 but now we&#39;re at a step where we can design a model more specific to prometheus.</div><div>Are all metric labels needed for inventory? Or is it just a subset?</div><div><br></div><div>There&#39;s also something that needs to be done to distinguish availability metrics (I think Lucas was adding a &quot;tag&quot; field in the model, indexed, allowing to query for metrics tagged &quot;availability&quot; ... 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?</div><div><br></div><div>I fear that having both &quot;tags&quot; and &quot;labels&quot; on the model can be quite confusing, but on the other hand we don&#39;t want to index all P labels in ispn.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 26, 2017 at 11:48 PM, John Mazzitelli <span dir="ltr">&lt;<a href="mailto:mazz@redhat.com" target="_blank">mazz@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I *think* I&#39;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&#39;s metric data and from there you will get the Prometheus metric family+labels so you know what you need to ask Prometheus for.<br>
<br>
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:<br>
<br>
        // don&#39;t copy properties - we are using the inventory properties for P labels right now<br>
        //m.getProperties().forEach((<wbr>k, v) -&gt; mb.property(k, v.toString()));<br>
<br>
        // map to the Prometheus metric timeseries<br>
        mb.property(&quot;hawkular.metric.<wbr>family&quot;, m.getMetricFamily());<br>
        mb.properties(m.<wbr>getMetricLabels());<br>
<br>
The object &quot;m&quot; is the agent&#39;s own Metric object that has a generic properties map. Right now I don&#39;t think we store anything in there so that commented portion of the code is no big deal at the moment.<br>
<br>
But notice the metric family name and the metric labels are all in the same generic properties for the inventory Metric object (that&#39;s what mb is).<br>
<br>
I don&#39;t like this. It means who ever queries inventory has to strip out the &quot;hawkular.metric.family&quot; key from the metric generic properties - the rest of the map are the real labels.<br>
<br>
I think we should make these first-class attributes in the inventory model:<br>
<br>
mb.metricFamily(m.<wbr>getMetricFamily())<br>
mb.metricLabels(m.<wbr>getMetricLabels())<br>
<br>
Thoughts? (looking at you Joel :-)<br>
<br>
[ps. this email was sent at 5:48pm on October 26, 2017]<br>
______________________________<wbr>_________________<br>
hawkular-dev mailing list<br>
<a href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/hawkular-dev</a><br>
</blockquote></div><br></div>