-1

i am using grafana-v7.3.6 on ubuntu. i basically have a timeseries with different versions as tags. I want to create a table with each version and its percentage of the total value. I am using opentsdb-v2.4 as my datasource.

example:

time,      metric,                 value
...      result{version = 1},      10
...      result{version = 2},      5
...      result{version = 1},      5
...      result{version = 3},      2
...      result{version = 1},      2
...      result{version = 3},      5
...      result{version = 2},      5
...      result{version = 1},      3
...      result{version = 2},      0
...      result{version = 3},      3

using series to rows transformations: i was able to get the following:

metric,                   value
result{version = 1},      20
result{version = 2},      10
result{version = 3},      10

What i would like is the following:

metric,                   value
result{version = 1},      50%
result{version = 2},      25%
result{version = 3},      25%

how can i achieve this? any pointers/suggestions would be really appreciated. thank you.

random_user
  • 73
  • 1
  • 6

1 Answers1

0

You need to replace the query you're using with the following:

your-query/scalar(sum(your-query))
  • can you please elaborate.. do you mean to do this in opentsdb expressions? grafana does not support expressions yet. – random_user Feb 03 '21 at 22:00