<div dir="ltr">The only one I&#39;ve used a lot among those you mention is mongodb query language. And honestly I don&#39;t like it very much, I find it quite counter-intuitive to use. It&#39;s all JSON, everything must be named and bracketed, I was quickly lost in a opened-closed-nested curly-braces hell. For instance, querying for age &gt; 40 is &quot;{age:{$gt:40}}&quot;. It&#39;s probably easy to implement as a query language, but it can become a nightmare for users. In db world I see it as a big step backward from SQL, which is much more &quot;natural&quot;. (I just found that blog post that explains it better than me: <a href="http://www.vertabelo.com/blog/notes-from-the-lab/sql-vs-mongo-query">http://www.vertabelo.com/blog/notes-from-the-lab/sql-vs-mongo-query</a> )</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 20, 2017 at 8:51 AM, Michael Burman <span dir="ltr">&lt;<a href="mailto:miburman@redhat.com" target="_blank">miburman@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">Hi,<br>
<br>
I&#39;d personally would want to see another type of functional language,<br>
such that would look like the one when you do Streams / RxJava. I guess<br>
it&#39;s closer to the one in MongoDB/RethinkDB/InfluxDB 2.0/Riemann, than<br>
the one in Prometheus/Graphite (PromQL is mostly evolution of Graphite&#39;s<br>
query language).<br>
<br>
And it could allow us to provide features such as streaming metrics,<br>
since we could transform those queries directly to reactive queries (we<br>
should take advantage of the fact that we process the metrics by<br>
reacting to them in the backend).<br>
<br>
    - Micke<br>
<span class=""><br>
<br>
On 07/19/2017 06:36 PM, Joel Takvorian wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I just want to share some ideas about the eventuality of having a<br>
&gt; language to perform some arithmetic / aggregations on metrics, before<br>
&gt; it goes out of my head...<br>
&gt;<br>
&gt; Here&#39;s an example of what I would personally love to see in Hawkular:<br>
&gt;<br>
&gt; ------------------------------<wbr>----------------<br>
</span>&gt; *Example:*<br>
&gt; /sum(stats(rate((id(my_metric)<wbr>, tags(a=foo AND b=bar),<br>
&gt; regexp(something_.+)), 5m), 10m))/<br>
<span class="">&gt; |<br>
&gt; |=&gt; &quot;id&quot;, &quot;tags&quot; and &quot;regexp&quot; all return a set of raw metrics (0-1 for<br>
&gt; id, 0-n for tags and regexp)<br>
&gt; |==&gt; &quot;(a,b,c)&quot; takes n parameters, all sets of metrics, and flatten<br>
&gt; them in a single set<br>
&gt; |===&gt; rate(set_of_raw_metrics, rate_period) computes the rate for each<br>
&gt; of them and return a set of metrics (map n=&gt;n)<br>
&gt; |====&gt; stats(set_of_raw_metrics, bucket_size) bucketize the raw<br>
&gt; metrics, returning the same number of bucketized metrics (map n=&gt;n)<br>
&gt; |=====&gt; sum(set_of_stats_metrics) sums every buckets, returning a<br>
&gt; single bucketized metric (fold n=&gt;1)<br>
&gt;<br>
&gt;<br>
</span>&gt; *Other:*<br>
<span class="">&gt; Functions like &quot;sum&quot; that take stats_metrics could have overloaded<br>
&gt; shortcut &quot;sum(set_of_raw_metrics, bucket_size)&quot; to perform the bucketing.<br>
&gt; In other words above example could be rewritten:<br>
</span>&gt; /sum(rate((id(my_metric), tags(a=foo AND b=bar),<br>
&gt; regexp(something_.+)), 5m), 10m)/<br>
<span class="">&gt;<br>
&gt; Note: we can do aggregations like &quot;sum&quot; on raw data if necessary, it<br>
&gt; just means we have to interpolate.<br>
&gt;<br>
</span>&gt; *Scalar operations:*<br>
&gt; /sum((id(a_metric_in_<wbr>milliseconds), *1000**id(a_metric_in_seconds)<wbr>), 10m)/<br>
<span class="im HOEnZb">&gt; ------------------------------<wbr>----------------<br>
&gt;<br>
&gt; Of course many other functions could come growing the library.<br>
&gt;<br>
&gt; Now I suppose the big question, if we want to do such thing, is &quot;are<br>
&gt; we going to invent our own language?&quot; I don&#39;t know if there are<br>
&gt; standards for this, and if they are good.<br>
&gt;<br>
&gt; The Prometheus query language cannot be transposed because a label is<br>
&gt; not a tag and it makes no sense for us to write something like<br>
&gt; &quot;my_metric{tag=foo}&quot;, it&#39;s either &quot;my_metric&quot; or &quot;tag=foo&quot;.<br>
&gt;<br>
&gt; The same language could be used both for read-time on-the-fly<br>
&gt; aggregations and write-time / cron-based rollups.<br>
&gt;<br>
&gt; WDYT?<br>
&gt;<br>
&gt;<br>
&gt;<br>
</span><div class="HOEnZb"><div class="h5">&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>
<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>