I also asked this on StackOverflow, but had no response there.
I have API that counts requests to it from different devices (platforms) and affiliates. Now, requests are stored in influxdb as integer counter.
I want to display table in grafana that shows percent of requests for each affiliate by platform from last hour. So, I compute the sum of requests over last hour per platform, sums per platform per affiliate, and now want to join that results back, to divide affiliate sums by total sums. But join node does not process any values, as shown by dot graph and by http queries to Kapacitor http://localhost:9092/kapacitor/v1/tasks/totaler
/joinedData
dbrp "telegraf"."autogen"
// TODO change to 1h or something
var WINDOW_PERIOD = 30s
var metrics = stream
|from()
.measurement('http')
.where(lambda: "url" == 'http://randometric:8888/metrics-app')
.groupBy(*)
|difference('Received')
.as('Received')
|window()
.period(WINDOW_PERIOD)
.every(10s)
var totalByPlatform = metrics
|groupBy('Platform')
|sum('Received')
.as('Received')
|httpOut('totalByPlatform')
var totalByAffiliate = metrics
|sum('Received')
.as('Received')
|httpOut('totalByAffiliate')
totalByPlatform
|join(totalByAffiliate)
.as('total', 'affiliates')
.on('Platform')
.streamName('affiliate_percent')
.fill('null')
|httpOut('joinedData')
|eval(lambda: "affiliates.Received" / "total.Received" * 100.0)
.as('Received_percent')
|InfluxDBOut()
.database('telegraf')
.retentionPolicy('autogen')
.measurement('computed_metrics3')