Ahh.. I haven’t used templating all that much but this also works for your substask variable so that you don’t have to enumerate all the possible values:
Template Variable Type: query query: SHOW TAG VALUES FROM numRecordsIn WITH KEY = "subtask_index" On Tue, Nov 1, 2016 at 2:51 PM, Jamie Grier <ja...@data-artisans.com> wrote: > Another note. In the example the template variable type is "custom" and > the values have to be enumerated manually. So in your case you would have > to configure all the possible values of "subtask" to be 0-49. > > On Tue, Nov 1, 2016 at 2:43 PM, Jamie Grier <ja...@data-artisans.com> > wrote: > >> This works well for me. This will aggregate the data across all sub-task >> instances: >> >> SELECT derivative(sum("count"), 1s) FROM "numRecordsIn" WHERE "task_name" >> = 'Sink: Unnamed' AND $timeFilter GROUP BY time(1s) >> >> You can also plot each sub-task instance separately on the same graph by >> doing: >> >> SELECT derivative(sum("count"), 1s) FROM "numRecordsIn" WHERE "task_name" >> = 'Sink: Unnamed' AND $timeFilter GROUP BY time(1s), "subtask_index" >> >> Or select just a single subtask instance by using: >> >> SELECT derivative(sum("count"), 1s) FROM "numRecordsIn" WHERE "task_name" >> = 'Sink: Unnamed' AND "subtask_index" = '7' AND $timeFilter GROUP BY >> time(1s) >> >> I haven’t used the templating features much but this also seems to work >> fine and allows you to select an individual subtask_index or ‘all’ and it >> works as it should — summing across all subtasks when you select ‘all’. >> >> SELECT derivative(sum("count"), 1s) FROM "numRecordsIn" WHERE "task_name" >> = 'Sink: Unnamed' AND "subtask_index" =~ /^$subtask$/ AND $timeFilter GROUP >> BY time(1s) >> >> >> On Fri, Oct 28, 2016 at 2:53 PM, Anchit Jatana < >> development.anc...@gmail.com> wrote: >> >>> Hi All, >>> >>> I'm trying to plot the flink application metrics using grafana backed by >>> influxdb. I need to plot/monitor the 'numRecordsIn' & 'numRecordsOut' for >>> each operator/operation. I'm finding it hard to generate the influxdb query >>> in grafana which can help me make this plot. >>> >>> I am able to plot the 'numRecordsIn' & 'numRecordsOut' for each >>> subtask(parallelism set to 50) of the operator but not the operator as a >>> whole. >>> >>> If somebody has knowledge or has successfully implemented this kind of a >>> plot on grafana backed by influxdb, please share with me the process/query >>> to achieve the same. >>> >>> Below is the query which I have to monitor the 'numRecordsIn' & >>> 'numRecordsOut' for each subtask >>> >>> SELECT derivative(sum("count"), 10s) FROM "numRecordsOut" WHERE >>> "task_name" = 'Source: Reading from Kafka' AND "subtask_index" =~ >>> /^$subtask$/ AND $timeFilter GROUP BY time(10s), "task_name" >>> >>> PS: $subtask is the templating variable that I'm using in order to have >>> multiple subtask values. I have tried the 'All' option for this templating >>> variable- This give me an incorrect plot showing me negative values while >>> the individual selection of subtask values when selected from the >>> templating variable drop down yields correct result. >>> >>> Thank you! >>> >>> Regards, >>> Anchit >>> >>> >>> >> >> >> -- >> >> Jamie Grier >> data Artisans, Director of Applications Engineering >> @jamiegrier <https://twitter.com/jamiegrier> >> ja...@data-artisans.com >> >> > > > -- > > Jamie Grier > data Artisans, Director of Applications Engineering > @jamiegrier <https://twitter.com/jamiegrier> > ja...@data-artisans.com > > -- Jamie Grier data Artisans, Director of Applications Engineering @jamiegrier <https://twitter.com/jamiegrier> ja...@data-artisans.com