marcingminski/sqlwatch

Grafana-Dashboard does not show the correct Database-Count

hvoges opened this issue · 4 comments

Describe the bug
If Grafana-Dashboard uses a Central Repository as the Data-Source, the Instance-Overview always shows only the database-Number of the last Instance in the List.

To Reproduce
Open the Grafana-Dashboard for a Central Repository and open the SQL Instance Overview. All-Databases shows the same number of databases for each instance.

Expected behavior
Database Count and Growth should be shown according to the filter settings.

Screenshots
image

if the SQLWatch-DB from the instance is used:
image

This is the result from the sqlwatch-query

image

To me it seems as if the dashboard always shows the last result.

Windows Server (please complete the following information):

  • OS Version: Server 2016

SQL Server (please complete the following information):

  • SQL Version: SQL Server 2017
  • SQL Edition: Enterprise

SQL Server Management Studio (SSMS -> about -> copy info):

  • paste "about" info here:

SQLWATCH version (from DACPAC or from sysinstances)

  • 4.4.0.523

Additional context
Add any other context about the problem here.

Thanks. I recall this issue but thought it was fixed. I'll look into it.

I used the Json-Files from the Github-Repo here:
https://github.com/marcingminski/sqlwatch/tree/main/SqlWatch.Dashboard/Grafana
Is there a more current version?

I just checked this in my test env, and the count is correct. Can you check if this view [dbo].[vw_sqlwatch_report_dim_database] returns the right databases, or let me see the results in CSV please?

And could you let me see results from this:

select *
from dbo.sqlwatch_meta_server s
outer apply (
	select *
	from [dbo].[vw_sqlwatch_report_dim_database] db
	where db.sql_instance = s.sql_instance
	and db.database_name = DB_NAME()
) dbs

Attached you find the results of the SQLwatch_meta_Server query.
sqlwatch_meta.csv