<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<font face="Calibri">Perhaps you could get some ideas from the
expression language we put together for the current metrics
alerter. It exists today but we could certainly change the
alerter to use a new query language, if/when it exists. I'd guess
a lot of people don't realize you can even query/alert on hMetrics
using these expressions. For example, you could do something like
this to test if the 90th percentile is greater than twice the
median for a metric set defined by a tagQuery, either combining
the metrics or testing them each individually.<br>
</font><br>
<pre style="box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 1.42857; word-break: break-all; word-wrap: break-word; color: rgb(51, 51, 51); background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); border-radius: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"> ( q(qNow,%90) > ( 2 * q(qNow,median) ) )</pre>
<font face="Calibri"><br>
<a class="moz-txt-link-freetext" href="http://www.hawkular.org/hawkular-metrics/docs/user-guide/#_query_based_alerting">http://www.hawkular.org/hawkular-metrics/docs/user-guide/#_query_based_alerting</a><br>
</font><br>
<div class="moz-cite-prefix">On 7/20/2017 7:58 AM, Joel Takvorian
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAJo5TF=Hq+JXia9f6PZBVqHzHf75kkD7RkrDjQGURew+cFsU9Q@mail.gmail.com">
<div dir="ltr">The only one I've used a lot among those you
mention is mongodb query language. And honestly I don't like it
very much, I find it quite counter-intuitive to use. It'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 > 40 is "{age:{$gt:40}}". It'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 "natural". (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"
moz-do-not-send="true">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"><<a
href="mailto:miburman@redhat.com" target="_blank"
moz-do-not-send="true">miburman@redhat.com</a>></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'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'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'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>
> Hi,<br>
><br>
> I just want to share some ideas about the eventuality
of having a<br>
> language to perform some arithmetic / aggregations on
metrics, before<br>
> it goes out of my head...<br>
><br>
> Here's an example of what I would personally love to
see in Hawkular:<br>
><br>
> ------------------------------<wbr>----------------<br>
</span>> *Example:*<br>
> /sum(stats(rate((id(my_metric)<wbr>, tags(a=foo AND
b=bar),<br>
> regexp(something_.+)), 5m), 10m))/<br>
<span class="">> |<br>
> |=> "id", "tags" and "regexp" all return a set of
raw metrics (0-1 for<br>
> id, 0-n for tags and regexp)<br>
> |==> "(a,b,c)" takes n parameters, all sets of
metrics, and flatten<br>
> them in a single set<br>
> |===> rate(set_of_raw_metrics, rate_period)
computes the rate for each<br>
> of them and return a set of metrics (map n=>n)<br>
> |====> stats(set_of_raw_metrics, bucket_size)
bucketize the raw<br>
> metrics, returning the same number of bucketized
metrics (map n=>n)<br>
> |=====> sum(set_of_stats_metrics) sums every
buckets, returning a<br>
> single bucketized metric (fold n=>1)<br>
><br>
><br>
</span>> *Other:*<br>
<span class="">> Functions like "sum" that take
stats_metrics could have overloaded<br>
> shortcut "sum(set_of_raw_metrics, bucket_size)" to
perform the bucketing.<br>
> In other words above example could be rewritten:<br>
</span>> /sum(rate((id(my_metric), tags(a=foo AND b=bar),<br>
> regexp(something_.+)), 5m), 10m)/<br>
<span class="">><br>
> Note: we can do aggregations like "sum" on raw data
if necessary, it<br>
> just means we have to interpolate.<br>
><br>
</span>> *Scalar operations:*<br>
> /sum((id(a_metric_in_<wbr>milliseconds),
*1000**id(a_metric_in_seconds)<wbr>), 10m)/<br>
<span class="im HOEnZb">> ------------------------------<wbr>----------------<br>
><br>
> Of course many other functions could come growing the
library.<br>
><br>
> Now I suppose the big question, if we want to do such
thing, is "are<br>
> we going to invent our own language?" I don't know if
there are<br>
> standards for this, and if they are good.<br>
><br>
> The Prometheus query language cannot be transposed
because a label is<br>
> not a tag and it makes no sense for us to write
something like<br>
> "my_metric{tag=foo}", it's either "my_metric" or
"tag=foo".<br>
><br>
> The same language could be used both for read-time
on-the-fly<br>
> aggregations and write-time / cron-based rollups.<br>
><br>
> WDYT?<br>
><br>
><br>
><br>
</span>
<div class="HOEnZb">
<div class="h5">> ______________________________<wbr>_________________<br>
> hawkular-dev mailing list<br>
> <a href="mailto:hawkular-dev@lists.jboss.org"
moz-do-not-send="true">hawkular-dev@lists.jboss.org</a><br>
> <a
href="https://lists.jboss.org/mailman/listinfo/hawkular-dev"
rel="noreferrer" target="_blank"
moz-do-not-send="true">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"
moz-do-not-send="true">hawkular-dev@lists.jboss.org</a><br>
<a
href="https://lists.jboss.org/mailman/listinfo/hawkular-dev"
rel="noreferrer" target="_blank"
moz-do-not-send="true">https://lists.jboss.org/<wbr>mailman/listinfo/hawkular-dev</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
hawkular-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/hawkular-dev">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>