marcingminski/sqlwatch

Grafana - Long Queries not displaying Query Text

dtaylor293 opened this issue · 1 comments

Steps to reproduce the behavior:
Browse to the Long Queries dashboard in Grafana. Within the Long Queries Grafana dashboard, the Query Text panel is not displaying the SQL text.
image

If you make the dashboard editable and view the panel query, it references an invalid column called statement on [dbo].[vw_sqlwatch_report_fact_xes_long_queries];

SELECT time=getdate(),sql_text, statement
FROM [dbo].[vw_sqlwatch_report_fact_xes_long_queries]
where [sql_instance] = '$sql_instance'
AND $__timeFilter(event_time)
AND long_query_id = isnull('$LongQueryId',-1)

To resolve, the query can be amended to remove the statement column;
SELECT time=getdate(),sql_text
FROM [dbo].[vw_sqlwatch_report_fact_xes_long_queries]
where [sql_instance] = '$sql_instance'
AND $__timeFilter(event_time)
AND long_query_id = isnull('$LongQueryId',-1)

SQL Server (please complete the following information):

  • SQL Version: [SQL Server 2016 SP2 CU15]

SQLWATCH version

  • 4.3.0.23725

Loving the Grafana dashboard by the way :)

Hi,

thanks for this. I believe this has already been raised but cannot find it so going to keep yours open.
I also believe that this has already been fixed in version 5.0 - although 5.0 is not yet released.

Loving the Grafana dashboard by the way :)

Thank you :)