<div dir="ltr">+1<div><br><div>Conversion based on labels seems more sane.</div><div><br></div><div>I wonder if a new tag that recalls the prometheus metric name would be useful; ex. &quot;baseName=jvm_memory_pool_bytes_committed&quot;, to retrieve all metrics of that family. Just an idea. </div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 1, 2017 at 4:25 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"><span class="">&gt; Are you also tagging the Prometheus metrics with the labels?<br>
<br>
</span>Yes, that is what was originally being done, and that is still in there.<br>
<div class="HOEnZb"><div class="h5"><br>
----- Original Message -----<br>
&gt;<br>
&gt; Mazz, this makes sense to me. Our decision to use unique ids (well +type) is<br>
&gt; going to lead to this sort of thing. The ids are going to basically be large<br>
&gt; concatenations of the tags that identify the data. Then, additionally we&#39;re<br>
&gt; going to have to tag the metrics with the same name/value pairs that are<br>
&gt; present in the id. Are you also tagging the Prometheus metrics with the<br>
&gt; labels?<br>
&gt;<br>
&gt; On 2/1/2017 9:38 AM, John Mazzitelli wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; The past several days I&#39;ve been working on an enhancement to HOSA that came<br>
&gt; in from the community (in fact, I would consider it a bug). I&#39;m about ready<br>
&gt; to merge the PR [1] for this and do a HOSA 1.1.0.Final release. I wanted to<br>
&gt; post this to announce it and see if there is any feedback, too.<br>
&gt;<br>
&gt; Today, HOSA collects metrics from any Prometheus endpoint which you declare -<br>
&gt; example:<br>
&gt;<br>
&gt;    metrics<br>
&gt;    - name: go_memstats_sys_bytes<br>
&gt;    - name: process_max_fds<br>
&gt;    - name: process_open_fds<br>
&gt;<br>
&gt; But if a Prometheus metric has labels, Prometheus itself considers each<br>
&gt; metric with a unique combination of labels as an individual time series<br>
&gt; metric. This is different than how Hawkular Metric works - each Hawkular<br>
&gt; Metric metric ID (even if its metric definition or its datapoints have tags)<br>
&gt; is a single time series metric. We need to account for this difference. For<br>
&gt; example, if our agent is configured with:<br>
&gt;<br>
&gt;    metrics:<br>
&gt;    - name: jvm_memory_pool_bytes_<wbr>committed<br>
&gt;<br>
&gt; And the Prometheus endpoint emits that metric with a label called &quot;pool&quot; like<br>
&gt; this:<br>
&gt;<br>
&gt;    jvm_memory_pool_bytes_<wbr>committed{pool=&quot;Code Cache&quot;,} 2.7787264E7<br>
&gt;    jvm_memory_pool_bytes_<wbr>committed{pool=&quot;PS Eden Space&quot;,} 2.3068672E7<br>
&gt;<br>
&gt; then to Prometheus this is actually 2 time series metrics (the number of<br>
&gt; bytes committed per pool type), not 1. Even though the metric name is the<br>
&gt; same (what Prometheus calls a &quot;metric family name&quot;), there are two unique<br>
&gt; combinations of labels - one with &quot;Code Cache&quot; and one with &quot;PS Eden Space&quot;<br>
&gt; - so they are 2 distinct time series metric data.<br>
&gt;<br>
&gt; Today, the agent only creates a single Hawkular-Metric in this case, with<br>
&gt; each datapoint tagged with those Prometheus labels on the appropriate data<br>
&gt; point. But we don&#39;t want to aggregate them like that since we lose the<br>
&gt; granularity that the Prometheus endpoint gives us (that is, the number of<br>
&gt; bytes committed in each pool type). I will say I think we might be able to<br>
&gt; get that granularity back through datapoint tag queries in Hawkular-Metrics<br>
&gt; but I don&#39;t know how well (if at all) that is supported and how efficient<br>
&gt; such queries would be even if supported, and how efficient storage of these<br>
&gt; metrics would be if we tag every data point with these labels (not sure if<br>
&gt; that is the general purpose of tags in H-Metrics). But, regardless, the fact<br>
&gt; that these really are different time series metrics should (IMO) be<br>
&gt; represented as different time series metrics (via metric definitions/metric<br>
&gt; IDs) in Hawkular-Metrics.<br>
&gt;<br>
&gt; To support labeled Prometheus endpoint data like this, the agent needs to<br>
&gt; split this one named metric into N Hawkular-Metrics metrics (where N is the<br>
&gt; number of unique label combinations for that named metric). So even though<br>
&gt; the agent is configured with the one metric<br>
&gt; &quot;jvm_memory_pool_bytes_<wbr>committed&quot; we need to actually create two<br>
&gt; Hawkular-Metric metric definitions (with two different and unique metric IDs<br>
&gt; obviously).<br>
&gt;<br>
&gt; The PR [1] that is ready to go does this. By default it will create multiple<br>
&gt; metric definitions/metric IDs in the form<br>
&gt; &quot;metric-family-name{<wbr>labelName1=labelValue1,<wbr>labelName2=labelValue2,...}&quot;<br>
&gt; unless you want a different form in which case you can define an &quot;id&quot; and<br>
&gt; put in &quot;${labelName}&quot; in the ID you declare (such as<br>
&gt; &quot;${oneLabelName}_my_own_<wbr>metric_name_${<wbr>theOtherLabelName}&quot; or whatever). But<br>
&gt; I suspect the default format will be what most people want and thus nothing<br>
&gt; needs to be done. In the above example, two metric definitions with the<br>
&gt; following IDs are created:<br>
&gt;<br>
&gt; 1. jvm_memory_pool_bytes_<wbr>committed{pool=Code Cache}<br>
&gt; 2. jvm_memory_pool_bytes_<wbr>committed{pool=PS Eden Space}<br>
&gt;<br>
&gt; --John Mazz<br>
&gt;<br>
&gt; [1] <a href="https://github.com/hawkular/hawkular-openshift-agent/pull/117" rel="noreferrer" target="_blank">https://github.com/hawkular/<wbr>hawkular-openshift-agent/pull/<wbr>117</a><br>
&gt; ______________________________<wbr>_________________<br>
&gt; hawkular-dev mailing list <a href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a><br>
&gt; <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>
&gt;<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; hawkular-dev mailing list<br>
&gt; <a href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a><br>
&gt; <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>
&gt;<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>
</div></div></blockquote></div><br></div>