In InfluxDB if there's no return at all, fill does nothing. I've opened an
issue to discuss this behavior:
https://github.com/influxdata/influxdb/issues/6967

Given https://github.com/influxdata/influxdb/issues/6412 I think it is
nothing Kapacitor can work around, either, but I will ask.

---------- Forwarded message ----------
From: Sean McGary <[email protected]>
Date: Wed, Jul 6, 2016 at 9:53 AM
Subject: [influxdb] Influxdb/kapacitor - join fails when one of the batch
queries returns 0 rows
To: InfluxDB <[email protected]>


Hey folks, Im having some troubles with an influxdb query with kapacitor.
First off, heres the tick script I have:


var requests = batch
   |query('''
      SELECT sum("value")
      FROM "apache_logs"."default".app_apache_status
      WHERE "http_status" != '500'
   ''')
      .period(20s)
      .every(20s)
      .align()
      .fill(0.0)

var requestErrors = batch
   |query('''
      SELECT sum("value")
      FROM "apache_logs"."default".app_apache_status
      WHERE "http_status" = '500'
   ''')
      .period(20s)
      .every(20s)
      .align()
      .fill(0.0)

requests
   |join(requestErrors)
      .as('requests', 'requestErrors')
      .tolerance(20s)
   |log()
      .level('DEBUG')
   |alert()
      .crit(lambda: "sum" > 0)
      .log('/tmp/kapacitor-app_apache_status-http_requests')
      .hipChat()


The fields in my measurement "app_apache_status" that are relevant to this
are: time, value (an int) and http_status (apparently a string?). The
queries should be pretty explanatory - one to get all 500 errors, the other
to get everything else.

The place where Im running into issues is that the query to get all of the
500 errors returns 0 rows most of the time which seems to be messing with
the ability to join to the other batch. Even with adding fill(0) it still
returns 0 rows.

My question: is there a way to always return at least 1 row where the sum
is simply 0, even if there are 0 rows that are found in the time range?

-- 
Remember to include the InfluxDB version number with all issue reports
---
You received this message because you are subscribed to the Google Groups
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit
https://groups.google.com/d/msgid/influxdb/6b233752-edd2-4523-9022-5c83dbcae344%40googlegroups.com
<https://groups.google.com/d/msgid/influxdb/6b233752-edd2-4523-9022-5c83dbcae344%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.



-- 
Sean Beckett
Director of Support and Professional Services
InfluxDB

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CALGqCvP959ZDKVRqbf8LuN1khvHkEq36Y9FeJpqO1mE%2BiyDbYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to