azuredatastudio: Profiler extension missing parameterized queries from ASP.NET Core + EF Core application
Hello, and thx for a wonderful new tool. I’m trying out the Profiler extension for SQL Operations Studio because some of my colleagues use Linux for .NET Core development, and this tool could be very helpful.
I outlined in an answer on Stack Overflow a way to use the Profiler for a very basic ASP.NET Core 2.1 + EF Core + Sql Server (docker or localdb), and got it to work nicely.
Now I’m trying to hook up to my actual ASP.NET Core 2.1.0 (with EF Core 2.1.0) application, but the important statements aren’t showing. I’m using Postman to hit my API with a simple GET of one value, but my profiler window only shows EventClass
lougout
rpc_completed
twicelogin
all from the “Core .Net SqlClient Data Provider
”. However, I was also expecting sql_batch_starting
and sql_batch_completed
or similar, with some SELECT
queries. In fact, that’s the only events I’m after at the moment.
Some additional info:
- If (on my Windows machine) I use SQL Server 2016 Profiler to do the same trace, then I do see
RPC:Completed
events withexec sp_executesql N'SELECT TOP(1)...
events containing my query. - If (on my Windows machine) I use SSMS 2016 to drill into Management > Extended Events > Sessions > Profiler > package0.ring_buffer (which I guess is related?), then click to the XML, I do see a
<data name="statement">
element with that sameSELECT
. It is contained in arpc_completed
event with a timestamp similar to the events that the Profiler in OpsStudio showed.
Surely the missing events are particular to my ASP.NET Core Web API application, but I can’t seem to find any relevant setting for this. I also am at a loss how to debug this further to provide you with a concise repro.
I would love to provide such a concise repro, but perhaps someone can point me in a good research direction?
Edit: see repro below.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 15 (8 by maintainers)
I can confirm that the suggestion seems to do the trick. See:
On a side note, doing this for a production install (as I have) you do get a:
popup. (Which makes sense since I “corrupted” the file by editing it.)
@PejmanNik Please try the latest insiders build: https://github.com/Microsoft/azuredatastudio/releases/tag/1.3.4 and the version 0.5.1 of Profiler extension.
ok somewhere is a template that maps event fields like “statement” to view fields like “TextData”. I will try to learn this part of the app to find a solution.
Get Outlook for Androidhttps://aka.ms/ghei36
From: Jeroen Heijmans notifications@github.com Sent: Monday, August 6, 2018 8:21:38 AM To: Microsoft/sqlopsstudio Cc: David Shiflet; Mention Subject: Re: [Microsoft/sqlopsstudio] Profiler extension missing parameterized queries from ASP.NET Core + EF Core application (#2125)
@shueybubbleshttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fshueybubbles&data=02|01||84719cd908234a421a4608d5fb972971|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636691549001313100&sdata=tOR3utoxqhEK9oIzzozdggqyRd48LfMXOyzV2qSnlJQ%3D&reserved=0 Aye, that is correct.
Here’s a screenshot of what SQL Server Profiler 2016 gives me for the exact same API call:
[image]https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F1590536%2F43716217-a0a8faf0-9983-11e8-9d19-c0a0f775c391.png&data=02|01||84719cd908234a421a4608d5fb972971|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636691549001313100&sdata=Q4RfbK%2BAOsEGxpKtdKkJWdAh0WFj45dNQ4YBPHo9frs%3D&reserved=0
And here is a screenshot of what I see in SSMS 2016 if I go to the ring buffer when I have just run the SQL Operations Studio Profiler trace for that query (the oldskool SQL Server Profiler was off during this screenshot):
[image]https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F1590536%2F43716269-def05fb0-9983-11e8-9967-5b419b853951.png&data=02|01||84719cd908234a421a4608d5fb972971|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636691549001313100&sdata=910hF3rjs4c5hD%2Ftia7GSYBwGTYHOGfvtFFAri90ZdQ%3D&reserved=0
Let me know if you require any other details, or if you need extra help in reproducing the issue.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fsqlopsstudio%2Fissues%2F2125%23issuecomment-410689362&data=02|01||84719cd908234a421a4608d5fb972971|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636691549001313100&sdata=skP40ZZFwYYJoBYUDscWuJHHtukT9nfVd7rlvseyBb8%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACHzCpO2zRceG8aF14i_AZMpgFg0Yt0xks5uODTSgaJpZM4VsMhm&data=02|01||84719cd908234a421a4608d5fb972971|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636691549001313100&sdata=zMVGeUSG7QhhbMH5hVPo5Dk3h3ZxZ0fhlj8W0QMuK2E%3D&reserved=0.