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

My TICKScript test returns no usable info #4

Open
Defozo opened this issue Oct 9, 2019 · 1 comment
Open

My TICKScript test returns no usable info #4

Defozo opened this issue Oct 9, 2019 · 1 comment

Comments

@Defozo
Copy link

Defozo commented Oct 9, 2019

This is my TICKScript:

var db = 'kong'

var rp = 'autogen'

var measurement = 'kong_requests'

var groupBy = []

var whereFilter = lambda: TRUE

var name = 'test-kong'

var idVar = name

var message = ' {{.ID}}'

var idTag = 'alertID'

var levelTag = 'level'

var messageField = 'message'

var durationField = 'duration'

var outputDB = 'chronograf'

var outputRP = 'autogen'

var outputMeasurement = 'alerts'

var triggerType = 'threshold'

var crit = 0

var data = stream
    |from()
        .database(db)
        .retentionPolicy(rp)
        .measurement(measurement)
        .groupBy(groupBy)
        .where(whereFilter)
    |eval(lambda: "request_time")
        .as('value')

var trigger = data
    |alert()
        .crit(lambda: "value" > crit)
        .stateChangesOnly()
        .message(message)
        .id(idVar)
        .idTag(idTag)
        .levelTag(levelTag)
        .messageField(messageField)
        .durationField(durationField)
        .log('/tmp/alerts.log')
        .mode(0644)

trigger
    |eval(lambda: float("value"))
        .as('value')
        .keep()
    

trigger
    |httpOut('output')

After running a test, the only output I got is:

[task_master:main] 2019/10/09 15:20:37 I! Started task: 19346d47-063f-4e1c-9cff-faa2c0dd30ce
[httpd] 172.18.0.3 - - [09/Oct/2019:15:20:37 +0000] "POST /kapacitor/v1/tasks HTTP/1.1" 200 1028 "-" "Go-http-client/1.1" 58cabd8f-eaa8-11e9-8164-000000000000 21499
[httpd] 172.18.0.3 - - [09/Oct/2019:15:20:38 +0000] "POST /write?db=kong&rp= HTTP/1.1" 204 0 "-" "Go-http-client/1.1" 593817d8-eaa8-11e9-8165-000000000000 3256

Nothing else.

I would expect some information if the alert was triggered or not?

@ForestJohnson
Copy link
Member

Oops, I missed this notification, sorry. I know its a bit late in the game now :( If you had posted the example data that you used when you hit this issue, I might still be able to debug it.

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