How to display empty graph in Grafana even if there is no data - grafana

I'm using Grafana v9.1.8.
I created a panel bases on data from influxdb.
The data only sent when application is working, so sometimes there is no data.
And the dashboard will show just 'No Data' in the middile of the panel without any graph.
I'm trying to keep the graph(axis) shown even if there's no data, but I cannot find the solution.

As far as I know, there is no such feature on Grafana at the moment, but I found this solution:
https://community.grafana.com/t/what-to-show-when-the-panel-is-without-data/66524/9
Make a fake union, check if you have any data and if you don't create some random time data without other parameters. As they say in the answer, this may not be scalable, as you need to add extra lines for each query, but it may be a workaround.

Related

Share kusto variables between grafana panels

Well, let's say that I have the query from my previous question: How to do multi graph time series on Grafana with Kusto
Then I'd like to consume the tiemposCicloBruto variable from one panel to another in order to avoid repeating queries.
I saw: https://grafana.com/blog/2020/10/14/learn-grafana-share-query-results-between-panels-to-reduce-load-time/
But there isn't any way to share variables at all...
I also tried it as a dashboard variable, but it doesn't seem to support tabular expressions at all...
You can share only input variables across dashboard panels. Variables work as primitive text substitution in one direction (from dashboard to query), and do not take into account any context in your query language.
Your link tells about sharing results of the query between different panels. If exact same result set returned to a panel fits your needs, you can reuse it "for free", without putting load on the database. You don't need to save it into any variable, you just set it as a pseudo-datasource and you get the result immediately.
You can factor this feature into design of you panels. Examples could be:
time series plus histogram visualizations of the same data;
time-series chart plus a panel with latest readings (or use other Grafana reduce expressions).

How do we change the "precision:ms" setting in the Grafana Query Inspector?

I have an InfluxDB database with only x11 data points in it. These data are not displaying correctly (or at least as I would expect) in Grafana when the time between them is shorter than 1ms.
If I insert data points 1 ms apart, then everything works as expected and I see all x11 points at the correct times, as shown below.:
However, if I delete these points and upload new ones but this time one point per 100 μs, then although the data displays correctly in InfluxDB, in Grafana I see only two points in my graph:
It seems like the data is being rounded/binned to the nearest millisecond, an that this is related to the “precision=ms” setting in the query here:
but I cannot find any way to change this setting. What is the correct way to fix this?
You can't configure Grafana to support different time precision for the InfluxDB. It is hardcoded in the source code: https://github.com/grafana/grafana/blob/36fd746c5df1438f27aa33fc74b24be77debc7ff/public/app/plugins/datasource/influxdb/datasource.ts#L364 (It may need to be fixed in multiple places of the source, not only in this one.)
So the correct way to fix it is to code it, which is of course not in the scope of this question.

In Grafana, is there a way to add manual data?

Looking for a way to add manual data into Grafana. Want to display the results of a simple survey consisting of questions such as, "how old are you?", "how long have you worked here?" and so on. Summarizing the answers in grafana with graphs or similar would be tremendous.
Setting up a data source for this seems unnecessary, wondering if there is a plugin or something that allows me to do this? Not too familiar with the JSON behind the panels, but maybe it is possible through that aswell.
If anyone is wondering why I'm trying to do this in such a weird and unfitting way, it's for a school thing... :)
You can generate graph by manually putting data. To do so:
Go to configuration: click on Add data source
Select TestData DB, Change the name and click Save & Test
Create new dashboard: Add Panel -> Add query -> select data source to TestData
Add data to string input field and Alias (i.e. How old are you?)
Learn more about TestData
You can use CSV plugin for grafana. I use excel and then save the data as CSV.
Below is snapshot of the data where we are portraying our test results.

Node Red MongoDB

I have sensor data from MongoLab to Node-RED and I want visualize this data using Node-Red dashboard in form of a gauge or chart.
Data from the mongoLab collection looks like this:
[{"_id":"5947e34de8fef902920defd8","sensorId":"5947340048225508","value":34,"date":"2017-06-19T14:44:29.000Z"},{"_id":"5947e34e6737e202b54f0a62","sensorId":"13359295204302776","value":25,"date":"2017-06-19T14:44:30.000Z"},{"_id":"5947e352e8fef902920defdc","sensorId":"5947340048225508","value":37,"date":"2017-06-19T14:44:34.000Z"},{"_id":"5947e3536737e202b54f0a66","sensorId":"13359295204302776","value":24,"date":"2017-06-19T14:44:35.000Z"}]
I want to visualize the values based on the sensorId...or is there any way I can be able to visualize this data using Node Red.
The function node is using the following javascript
msg.headers = {"Content-Type":"application/json"};
return msg;
My intention is to visualize the sensor value on the ui_gauge or chart.
Make a gauge/graph for each of the unique data steams you want to reflect in the UI/dashboard,
Then you'll need to double the output lines to another function that passes this information to the msg.payload, and then from that function, tie it to the corresponding dashboard gauges.
A gauge will obviously show the last value sent, while a graph will show you a history. May need to tweak the visual layout of the dashboard gauges/charts to show more data, to your liking.
Flow Chart Example
Your code might look something like this in the new forked function that is then tied to your gauges:
msg.payload = msg.value;
return msg;
or you can use a switch, that then breaks the values to multiple outputs, that then each output goes to a corresponding gauge to reflect the data.
Flow Chart Example Using Switch
I really hope this helps.

Tableau performance

I've a problem with the dashboard in Tableau. In the dashboard there are many worksheets, and all the columns that are in the report are calculable. The problem is that dashboard is being formed for a very long time. The report contains approximately 2 million rows. And it is generated about 5 minutes.
Tell me, what are the solutions in this case?
Maybe I can somehow adjust the page display and not all the records at once?
To reduce the calculation time, try to exclude data you don't need with a data source filter in tableau. You can also hide or delete unused calculated fields. Other things you can do is reduce sheets that are not used.
Here's a link: https://www.tableau.com/about/blog/2016/1/5-tips-make-your-dashboards-more-performant-48574
Steps to follow to reduce calculation time:
Extract the data and use Extract data and also keep option as extract instead of live.Also replace the data source using extract data.
Use "User Filter" to reduce calculation time so that tableau will display of particular user data only.
I hope this will work to solve your problems.
I have one more idea to resolve this issue.
1)when you loan first time your dashboard put into Dashboard Action Filter
First Time load dashboard data exclude in your sheet.
Dashboard Menu->Action->add action->select sheet and exclude option.
2) Live to Extract data source and select radio button extract.
3)use user filter.
I am following the other answers (use extract, dashboard action filter...) and I want to add one point:
Drag every field used by any tablesheet on the dashboard on "Detail" of every tablesheet you are using on the Dashboard. Now Tableau loads all needed data while loading the first tablesheet and can use this data for the other sheets.
i.e. A dashboard contains three tablesheets (A, B, C) now you drag every field used by A on "Deatil" of B and C, every field used by B on "Deatil" of A and C, every field used by C on "Deatil" of B and A.
We are also having a similar issue with 150 million rows but I want to check if you are doing following steps. This may help you. This goes back to fundamentals of Tableau reporting.
1/ Try to make sure your data set is in star schema format. This will help a lot in report.
2/ Try to have tables and views in DB in such a way that same columns are used in Tableau. Any extra columns in tables adds to the performance issue.
3/Make sure indexing is done properly for all the fields that are joined.
4/ In my experience Dashboard adds extra performance lag. So make sure you try to get as much performance tuning on sheets as possible before even going to dashboard.
5/ If required try to use materialized views.
hope this helps.
Try to capture performance metrics using performance recorder option in Tableau.
Check for the underlying DB tables and joins present on the data source layer.
Try using optimized sets and parameters as required and get rid of less relevant filters.
Try using data extracts with scheduled refresh with data source filter for limited business years data.