VolkovLabs / business-text

Dynamic, data-driven text for @grafana
https://docs.volkovlabs.io
Apache License 2.0
79 stars 14 forks source link

Panel Does Not Render When The First Datasource Does Not Have Data #352

Closed bliu13 closed 1 week ago

bliu13 commented 2 weeks ago

I've noticed an issue where the Business Text panel renders the default content if the first (Infinity) data source does not have data. The only configuration needed to reproduce the issue is to create 2 or more Infinity data sources, and to change the Render Template to All Data.

The following JSON would cause the Business Text panel to render the default content:

[
  [],
  [{"some":"some"}],
  [{"data":"data"}],
]

The following JSON would behave as expected and the Business Text panel will render the content using the handlebars and Javascript code:

[
  [{"some":"some"}],
  [],
  [{"data":"data"}],
]

I have also attached an exported sample dashboard. The Business Charts panel does not seem to suffer from this problem. Business Text With Multiple Infinity Datasources-1724948651025.json

mikhail-vl commented 2 weeks ago

@bliu13 Thank you for submitting the issue. We will investigate and update in the upcoming release.

bliu13 commented 2 weeks ago

I initially thought this issue only applied to the Business Text plugin, but it looks like all built-in and plugin visualizations are behaving the same way on the latest versions of Grafana.

mikhail-vl commented 2 weeks ago

@bliu13 Grafana Cloud or OSS? There is a difference between them in the latest versions. Grafana Cloud has Scenes Dashboards enabled by default.

bliu13 commented 1 week ago

I tested on both Grafana Cloud and OSS. I spoke to Grafana support about what I was seeing and with examples. I've attached a test dashboard with only Infinity and Business Text as requirements.

Bar charts (and maybe time series) does not appear to support multiple data sources, but they still behave the same way where if the first data source does not have data, then it will say there's no data. Business Text also behaves this way.

example_visualizations.json

I suppose there is a workaround I could do if I simply did hard code data to exist on the data source:

[
  [{"InfinitySourceDataInlined": "alwaysExists"}],
  [{"realData": "starts from the second one"}],
  [{"moreRealData": "this should work"}]
]
mikhail-vl commented 1 week ago

@bliu13 Thank you. We will look into it.