marcingminski / sqlwatch

SQL Server Performance Monitor
https://docs.sqlwatch.io
Other
424 stars 168 forks source link

Grafana-Dashboard does not show the correct Database-Count #462

Open hvoges opened 1 year ago

hvoges commented 1 year ago

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):

SQL Server (please complete the following information):

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

SQLWATCH version (from DACPAC or from sysinstances)

Additional context Add any other context about the problem here.

marcingminski commented 1 year ago

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

hvoges commented 1 year ago

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?

marcingminski commented 1 year ago

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
hvoges commented 1 year ago

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