Change the config settings per column in a Grafana table - grafana

I have a table in Grafana that has several columns and uses the gauge display mode. Setting the min/max values for these columns is troublesome. If the column is a percentage value the max is always known so can be hard coded as 100 or 1. But for example a column displaying database sizes the max is not known and will change.
I am running Grafana 8.1.2 so tried the new 'config from query results' transform for the first time. This works fine to alter the values of a single column but not for more than one.
Grafana Table
As you can see in the attached picture I have set the max for the database size using the new transform but I also need to be able to set the max for the log size column too.
The dashboard has 2 queries in it, both for MSSQLServer. Query A returns the results in a table format and Query B returns the config settings: query result
I've then got the transform set up as follows: transform set up
Is there a way to set the min\max settings for multiple columns using this new transform that I'm missing or some other technique to do it. Unfortunately (for me) Grafana seems to favour time series data so isn't as configurable for table data.

Related

How to plot horizontal line in Timeseries in Grafana

I use grafana to plot timeseries data. In a timeseries plot i want to add a constant line which comes from a monitoring level. The value of that level is dynamic (from a postgres database) the timeseries come from a ifluxdb Datasource.
The monitoring level have no timestamp. The result should look like this:
I have searched quite a while how to do this, but not found a good explanation.
You can now add thresholds (bottom of the edit screen).
Each threshold can be represented as a solid line and/or region with individual color
Another way to do it in a dirty way is to create panel with a mixed data source.
Create your variable in grafana - it can be a query, constant or custom. Just remember to keep it a single floating point.
Add your original query and add the prometheus data source to query your variable.
${net_ordered_storage}
You will have to play a little bit with the number of data points displayed (query options>max data points) and minimum step of data point in prometheus query to make grafana connect dots.
Green horizontal line from variable
To draw a line like that you have to "fake" a timeseries. (thresholds don't work since they can not be dynamic as far as I know)
First thing to keep in mind is that grafana needs timestamp to plot it, for this reason the global variables ${__to} and ${__from} come in handy.
Then, to draw a line, grafana needs at least two points. ([t0, t1][y0, y1])
So this is the sql (postgre) query that lead to the desired result:
SELECT
${__from} AS time,
level_1,
FROM my_table where display_name = '${my_grafana_var:raw}'
union all
SELECT
${__to} AS time,
level_1,
FROM my_table where display_name = '${my_grafana_var:raw}';
It is possible to add dynamic thresholds using the Config from query option.
Add a new query below your standard metric query. This will likely be called B.
Here you query the static reference value.
Eg SELECT expected_number_of_widgets FROM baseline
Open Transformation tab
Find Configuration from Query results
Choose Config query = B
At the dropdown for expected_number_of_widgets, choose Use as: Threshold1.
In the right panel, under Thresholds, make sure Show Tresholds is enabled and remove the default threshold of 80.
For more details, see https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/transform-data/#config-from-query-results

Scale column values on a table in Grafana

I have a query in Prometheus QL which show values as a table in Grafana. My issue is that a value updated is in epoch time and in order to show human readable date I would need to multiply by 1000. There is a way to multiply value and then show? Not sure if it is possible somehow by tuning the below query or this feature is not supported at all in Grafana. I've already made some attempts but I had no luck.
This is my query:
min(helm_chart_info{chart=~"$chart", exported_namespace=~"$namespace", release=~"$release"}) by (chart, release, exported_namespace, updated, version) != 2

Metric showing higher value in blended data when date range comparison is added

I have two data sources in Google cloud storage buckets. I am blending them in Google data studio as follows:
I have created a simple table chart which is working fine:
But when I set Comparison date range option to Previous period, the cost numbers displayed in the same table go haywire but the summary row which displays the total cost is fine. I don't observe this issue if the data is not blended.
When you enable "Comparison data range" it only show comparable data (that means, data that can be comparable with something).
Since your data source probably contains rows of a dates that doesn't have a relative row to compare with (the previous period), that data is filtered out from your visualization.

tableau show categories from calculation even when a category is not visible

I have a calculation and it outputs multiple values. Then I am creating a table on those values. For example, in below data my formula is
if data is 1 then calculation is `one`
if data is 2 then calculation is `two`
if data is 3 then calculation is `three`
as three doesn't really appear in the output, when I create a table, three is not displayed. Is there any way to display it?
I tried table layout >> show empty rows and columns and it didn't work
data calculation
1 one
2 two
Tableau discovers the possible values for a dimension field dynamically from the query results.
If ‘three’ does not appear in your data, then how do you expect Tableau to know to make a column header for that non existent, but potential, value? It can’t read your mind.
This situation does occur often though - perhaps you want row or column headers to remain stable, even when you change filters in a way that causes some to no longer appear in the query results.
There are a few ways you can force Tableau to pad ** or **complete a domain:
one solution is to pad your data to make sure each value for your dimension field appears in at least one data row.
You can often do this easily by using a union to append some extra rows to your original data. You can often add padding rows that don’t impact any results by leaving all your Measure columns null since nulls are ignored by aggregation functions
Another common solution that is a bit more effort is to make what is known as scaffolding data source that is not much more than a list of your dimension members. You can then use that data source as a primary data source with data blending, making your original data source secondary.
There are two situations where Tableau can detect the absence of data and leave space for it in the visualization automatically
for numeric types, you can create a bin field that will automatically pad for missing bins
similarly, date fields can show missing values because, like bins, Tableau can tell when a month doesn’t appear in the data and leave room for it in the view

Named ranges in google spreadsheet charts?

Edit: This question relates to the "old" google spreadsheets that were current in 2013.
Is it possible to use named ranges in google spreadsheet charts?
I need to dynamically update the dimension (starting position and size) of a range and be able to reflect it in a chart, i.e. I need the chart source range to follow the position of moved source data range.
Extra information:
I've got two sheets. One has a header followed by 'input' row and data rows. When I type anything into 'input' row my script automatically adds a row just after this one and moves my new input there, therefore creating new row of data.
About chart: If I assign a data range that includes only data rows, new row won't be included because whole 'old' range got shifted. $ sign is ignored when specifying data range. So what I'm doing is to include in the range my 'input' + 1 header row. They have no values so in the chart you cannot see data points in the first two positions. I'm using a combo chart with another range from another sheet that has no header, so it looks like this:
(usually there is some value for the green histogram right at the origin of the chart).
So the line chart is shifted by two positions to the right, but it should start from position 0, so I want the chart to somehow follow the range or to redefine it, so it always stars from the first data row. I hope it makes sense.
Charts use range as argument, have you tried to simply use getRangeByName to define the range ?
Charts don't support named ranges. However, you can set up your chart so that the source data range is an entire column (for example, Sheet1!D:D). Then the chart will show all the values in that column, taking into account even rows that you will add (or delete) after chart creation. If the first rows (for example 4) contain table headers you can specify something like Sheet1!D5:D as your source data range
In searching for this, I found a solution I thought I'd share.
I have a set of data from which I'd like to create a set of charts. My fairly simple workaround was to create a new tab for each chart with a pivot table to pull in my data based on my criteria for each chart. I inserted a row at the top to hold a SUM of my values in the pivot table below, rather than referencing the moving "Total" cell in the pivot table itself.
Note: I hid the title row of the pivot table and unchecked the "Totals" within it to get the SUM to work correctly. Hope this helps someone!