influxdata / influxdata/kapacitor

Error found when convert int to float

Open
#1,438 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

This is the error found in /var/log/kapacitor/kapacitor.log:

```
[system_load:eval2] 2017/06/15 13:55:29 E! Cannot call function "float" with args signature (missing), available signatures are [(boolean), (string), (int), (float)].
```

And this is the system_load tickscript:

```stream
|from()
.database('telegraf')
.retentionPolicy('autogen')
.measurement('system')
.groupBy('host', 'inst')
|eval(lambda: "load1" / float("n_cpus"))
.as('perload')
|alert()
.id('{{ index .Tags "host" }}/{{ index .Tags "inst" }}')
.message('{{ .Level}}: {{ .ID }} has high perload: {{ index .Fields "perload" }}')
.stateChangesOnly()
.crit(lambda: "perload" > 0.5)
.exec('/data/mysqlscript/tick/alarm.py')```

This error continue to appear in error log, but the question is, the alert still be triggered correctly...
So what does the error mean?

Contributor guide

Open the contributing guide

Research direction

Start with the reported Kapacitor log entry and the tickscript expression `float("n_cpus")`; trace how the eval expression handles the field and why it reports a missing argument. Compare that behavior with the alert result shown in the report. Done means documenting the cause of the error and whether it affects alert correctness.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.