Table.new() grafonnet

I found the API docs here for the grafonnet lib’s table.new() function:

I can’t find any examples for how to use it though. Are “columns” just an array of strings for the column headers? Would I do something like this?

table.new('My Table', columns=['Col 1', 'Col 2']).addTargets([prometheus.target('sum by(node)......')])

(also, I have seen tablePanel.new in some places… did that get renamed to table.new?)
where each target matches with the same index of the column headers?
Thanks!

1 Like

I may have found the answer to my question… the “columns” are just which fields should be shown in the metrics returned by the targets… And I suppose if there are multiple targets, they must all have the same fields (or at least those that are “chosen” in the columns field).

(though any examples of how to use this would still be appreciated!)

1 Like

Hello m1o1,

I recently started working with Grafonnet and ran into the same issues as you. Did you make any progress since your post and could share examples of how to use and style the table panel with Grafonnet?