Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two Lambdas in Eval Node Not Retaining Fields #631

Closed
mingraham opened this issue Jun 9, 2016 · 10 comments
Closed

Two Lambdas in Eval Node Not Retaining Fields #631

mingraham opened this issue Jun 9, 2016 · 10 comments

Comments

@mingraham
Copy link

mingraham commented Jun 9, 2016

Hello,

I have been debugging an issue where a message alerted to my Slack channel from Kapacitor v0.13.1 looks like

development's info is %!f(MISSING)% of the 24 hour average. Mean of %!f(MISSING) over the last 24 hours and mean of %!f(MISSING) over the last 5 minutes at 2016-06-09 21:47:20 +0000 UTC.

whereas it previously was working with a message like

development's info is 59.90% of the 24 hour average. Mean of 4.05 over the last 24 hours and mean of 2.42 over the last 5 minutes at 2016-06-02 16:49:10 +0000 UTC. 

My TICKscript looks like the following:

var oneDayMean = batch
    |query('SELECT mean(sum) FROM "db"."default".measurement')
        .period(1d)
        .every(10s)
        .align()
        .groupBy(*)
    |shift(1d)

var fiveMinuteMean = batch
    |query('SELECT mean(sum) FROM "db"."default".measurement')
        .period(5m)
        .every(10s)
        .align()
        .groupBy(*)
    |shift(5m)

oneDayMean
    |join(fiveMinuteMean)
        .as('oneDayMean', 'fiveMinuteMean')
        .fill(0)
    |eval(lambda: "fiveMinuteMean.mean" / "oneDayMean.mean", lambda: "decimalOf" * 100.0)
        .as('decimalOf', 'percentageOf')
        .keep('fiveMinuteMean.mean', 'oneDayMean.mean', 'percentageOf')
    |alert()
        .message('{{ index .Tags "environment" }}\'s info is {{ index .Fields "percentageOf" | printf "%0.2f" }}% of the 24 hour average. Mean of {{ index .Fields "oneDayMean.mean" | printf "%0.2f" }} over the last 24 hours and mean of {{ index .Fields "fiveMinuteMean.mean" | printf "%0.2f" }} over the last 5 minutes at {{ .Time }}.')
        .info(lambda: "percentageBelow" < 0.99)
        .warn(lambda: "percentageBelow" < 0.98)
        .crit(lambda: "percentageBelow" < 0.97)
        .slack()

I cannot seem to figure out what went wrong here, because I do not remember changing the syntax.

@mingraham mingraham changed the title 0.13.1 Eval Keep Method Broken Two Lambdas in Eval Node Not Retaining Fields Jun 9, 2016
nathanielc added a commit that referenced this issue Jun 10, 2016
@nathanielc nathanielc mentioned this issue Jun 10, 2016
3 tasks
@nathanielc
Copy link
Contributor

@mingraham I have fixed the issue #635. This was a definite regression and tests have been added to prevent further regressions.

@mingraham
Copy link
Author

Ok, thank you @nathanielc. Is the updated code in the nightly build?

@mingraham
Copy link
Author

Also, what build is the last stable build without this bug in it? I am taking the TICKscript I am referencing into production today, and would like to use stable builds.

@nathanielc
Copy link
Contributor

Its not in the nightly build yet.

I believe you would have to go back to v0.12 to avoid this bug.

FWIW I will be cutting 1.0.0-beta2 early next week with this fix.

@mingraham
Copy link
Author

Ok, thanks for the quick work, much appreciated!

@mingraham
Copy link
Author

@nathanielc I actually am not able to find a version of Kapacitor that is 0.12. Where should I download this from?

@nathanielc
Copy link
Contributor

nathanielc commented Jun 13, 2016

@mingraham Sorry for the delay, old releases are all under

https://dl.influxdata.com/kapacitor/releases/

To get the 0.12.0 rpm for example

https://dl.influxdata.com/kapacitor/releases/kapacitor-0.12.0-1.x86_64.rpm

Or the deb

https://dl.influxdata.com/kapacitor/releases/kapacitor_0.12.0-1_amd64.deb

@mingraham
Copy link
Author

mingraham commented Jun 13, 2016

@nathanielc: Thank you for the links, but looking through https://dl.influxdata.com/ with CMD+F, I could not find either of those available (I had looked here previously). Is there another way to check for existing downloadables?

EDIT: That .deb is not found when I try to wget.

@nathanielc
Copy link
Contributor

@mingraham Sorry copy paste error, link updated.

@rossmcdonald Do you know if we have any location where you can find link to old versions?

@mingraham
Copy link
Author

A tab to the right of Nightly listing all the available builds (including the current and previous) would be pretty incredible here: https://influxdata.com/downloads/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants