<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Ben,</div><div class=""><br class=""></div><div class="">Comments inline...</div><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 17, 2017, at 6:10 PM, Benjamin Heiskell &lt;<a href="mailto:bheiskell@datto.com" class="">bheiskell@datto.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hey all,</div><div class=""><br class=""></div><div class="">I recently deployed Hawkular because I found its scaling model appealing. It has been working well for our basic monitoring usage when combined with Grafana.</div><div class=""><br class=""></div><div class="">One of my consumers is trying to graph KPIs that involve cross-metric mathematics like sums, division, and moving averages (i.e., post-ingress transformations). I looked into how to accomplish this with Hawkular, but I didn't see any obvious way to do it. The stats endpoint seems to only support aggregations on a single metric/tag at a time. I'm finding that we can't visualize these metrics the same way you can with other TSDBs like Graphite/Prometheus.</div></div></div></blockquote><div><br class=""></div><div>The stats endpoints actually do support querying across multiple metrics; however, docs are really lacking which makes it that much easier to miss. I have some docs updates underway. I will try to get to include sections on stats queries. Let me provide a few examples for now.</div><div><br class=""></div><div>GET /hawkular/metrics/gauges/stats?tags=$tagsQuery</div><div><br class=""></div><div>where tagsQuery might be like:</div><div><br class=""></div><div>&nbsp; &nbsp; 'hostname=host1'&nbsp;</div><div><br class=""></div><div>&nbsp; &nbsp; 'hostname=host1&nbsp;AND env=stage’</div><div><br class=""></div><div>&nbsp; &nbsp; 'hostname=<a href="http://myserver.com" class="">h</a>ost1&nbsp;OR hostname=host2’</div><div><br class=""></div><div>&nbsp; &nbsp; 'hostname IN [host1, host2, host3]'</div><div><br class=""></div><div>&nbsp; &nbsp; 'hostname NOT IN [host4, host5]’</div><div><br class=""></div><div>The /gauges/stats endpoints supports all the other parameter that are supported by /gauges/{id}/stats. There is a corresponding endpoint for counters:</div><div><br class=""></div><div>GET /hawkular/metrics/counters/stats?tags=$tagsQuery</div><div><br class=""></div><div>You can also query for rates:</div><div><br class=""></div><div>GET /hawkular/metrics/counters/rates/stats=$tagsQuery</div><div><br class=""></div><div>Again, these endpoints all support the same query parameters.</div><div><br class=""></div><div>There are POST version as well where the query parameters are instead specified as JSON in the request body.</div><div><br class=""></div><div>POST /hawkular/metrics/gauges/stats/query</div><div>POST /hawkular/metrics/counters/stats/query</div><div><br class=""></div>The POST endpoints were added in support of the Grafana data source plugin. See&nbsp;<a href="https://issues.jboss.org/browse/HWKMETRICS-410" class="">https://issues.jboss.org/browse/HWKMETRICS-410</a>&nbsp;and&nbsp;<a href="https://issues.jboss.org/browse/HWKMETRICS-465" class="">https://issues.jboss.org/browse/HWKMETRICS-465</a>&nbsp;for background on the POST endpoints.&nbsp;</div><div><br class=""></div><div>There are some other endpoints that provide batch query support. I will save the details on those since are not inquiring about them.</div><div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">I did a little research, and found Heiko Rupp's blog post on HawkFX where he seems to already be exploring this idea [1]. Perhaps the query language item on the 2017 road map refers to incorporating this?</div><div class=""><br class=""></div><div class="">I would like to assist in developing this feature. Given that there is already a tags DSL, it seems like it would make sense to extend that to support metric transformations.</div><div class=""><br class=""></div><div class="">Grafana is also considering adding this to Grafana itself, but it doesn't look like the ticket has any traction [2]. Additionally, shipping potentially megabytes of data to Grafana (or the user's browser) to aggregate doesn't seem ideal.</div><div class=""><br class=""></div><div class="">I documented a few TSDB DSLs styles here [3].</div><div class=""><br class=""></div><div class="">What do you all think?</div></div></div></blockquote><div><br class=""></div><div>Absolutely agree that Hawkular Metrics would benefit greatly from query language. It would compliment the Grafana plugin nicely. Contributions of any kind, mailing list, IRC (#hawkular) discussion, pull requests, etc, are always welcomed and appreciated. I suggest creating a ticket at&nbsp;<a href="https://issues.jboss.org/secure/CreateIssue!default.jspa" class="">https://issues.jboss.org/secure/CreateIssue!default.jspa</a>&nbsp;(be sure to select Hawkular Metrics for the project.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Ben<br class=""></div><div class=""><br class=""></div><div class="">[1] <a href="http://pilhuhn.blogspot.com/2016/09/computed-metrics-for-hawkfx.html" class="">http://pilhuhn.blogspot.com/2016/09/computed-metrics-for-hawkfx.html</a></div><div class="">[2] <a href="https://github.com/grafana/grafana/issues/3677" class="">https://github.com/grafana/grafana/issues/3677</a></div><div class="">[3] <a href="https://gist.github.com/bheiskell/25af2543ee8588f70895b0311ef291d3" class="">https://gist.github.com/bheiskell/25af2543ee8588f70895b0311ef291d3</a></div><div class=""><br class=""></div></div>
_______________________________________________<br class="">hawkular-dev mailing list<br class=""><a href="mailto:hawkular-dev@lists.jboss.org" class="">hawkular-dev@lists.jboss.org</a><br class="">https://lists.jboss.org/mailman/listinfo/hawkular-dev<br class=""></div></blockquote></div><br class=""></body></html>