Forum Discussion
Getting SQL query performance into log analytics
Hi all , im not entire sure what is the performance counter you need, but you can try something like this.
go to the log analytics, -> Advance (In the settings like image below) :
then choose :
Then I think you just need to add something like this :
You can also add the performance counter of your choice.
You need to check what is the perfomance counter you need.
Hope this helps.
A least for me there isn't a perf counter for what I wanted. It needs to run a query inside sql and send the output to log analytics.
- PatrikHanssonAug 26, 2020Brass Contributor
I'm not a SQL guru but would like to get information on queries not behaving nice. It's been a while since I looked at this so I don't remember exactly what queries I was using in smss to get the info I wanted, and since i couldn't get it up on the dashboard at that time I stopped exploring.
But it was something like https://www.sqlserver-dba.com/2016/10/how-to-find-longest-running-queries-in-sql-server.html so I guess it was from https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-query-stats-transact-sql?view=sql-server-ver15.
- Scott_KinghornAug 25, 2020
Microsoft
PatrikHansson I am working on the SQL monitoring preview you saw in the tweet. We are calling DMVs to get the sql monitoring data. Currently we don't return a lot of details on query perf stats in the preview version. Is there a DMV that you would like to use for this? For example, sys.dm_exec_query_stats.