Stop AI tracing
I noticed that in TelemetryDebugWriter there's code that writes to VS's output window (line #56). Is there an option to disable it? It interferes with my ability to debug my application...
Use this:
TelemetryDebugWriter.IsTracingDisabled = true;
@SergeyKanzhelev this does more than stop writing on the debug output window! it stops insights recording at all! my "Data From last Debug Session" now is completely empty...
Visual Studio relies on debug output data to show the session's data. We have plans to switch to ETW instead. @gardnerjr can share more details
Yes, the VS tools get this information by watching the debug output.
@Leonardo-Ferreira we've discussed at various point adding a right click option in the output window for "show application insight output" that would hide/show the output, without having to disable output from the sdk itself.
"we've discussed at various point adding a right click option in the output window for "show application insight output" that would hide/show the output, without having to disable output from the sdk itself."
Yes please! This seems to be the most appropriate solution imo. One almost expects to find it there.
Is there an issue to track adding that option, or moving away from using the Debug window? I'm also very eager to get rid of those messages and I'd like to follow the discussion.
@gardnerjr any updates on this?
temporary re-opening the issue to follow up on the plans
It's been discussed but never prioritized.
I've added User Story 1049894: Add functionality to hide AI output in the debug output window to our backlog, but I can't make any promises on if it will get scheduled in 15.4. The next VS update is a servicing release and is very tightly scoped.
Thank you for adding User Story 1049894. It's helpful to know that it is on the backlog and will be looked at when feasible.
Is there an update to the filter? Since the telemetry appears in the Application Insights search most don't have a need for it to still be in the debug, and it really makes any other debug output really hard to read.
Any update on this? Would really like an option setting somewhere to not have to scroll through hundreds of lines of AI Telemetry to see my one line of debug output.
@gardnerjr do you know if this work was scheduled yet?
No work has been scheduled for it. If you haven't already, you might want to submit an item directly from the VS feedback tool as well, especially if this is an asp.net related thing. Some other teams outside of AI are starting to take over work in our VS extension to make their experiences better. This would be one place we could maybe get another team to help out.
Will do.
Looks like there is one thread active on it right now: https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/19370182-add-filter-for-application-insights-debug-events-i
Though it was posted in late May of 2017, so hopefully it gains more traction/notice.
Please. It really has become more than a nuisance that the same service we happily use to understand our code runs denial-of-service against another major source of "application insight". A jealous and ruthless mistress, although otherwise quite sexy. Please silence her.
@glennc and @acearun any chance this will be prioritized? I want to make sure you heard the feedback.
@Hassmann nicely said. Sorry for inconvenience. It is hard choice - telemetry vs. debug output. I re-opened this issue to highlight it, but will close it couple days later. From SDK perspective - all the data needed to be surfaced is already exposed via ETW. So it is a matter of powering search experience from ETW instead of the debug output.
when you say it is exposed, where are the details of how that works? is it explicitly documented somewhere?
will ETW work for places when the app being debugged is occurring somewhere else, like inside a container? will it work for different apps being debugged multiple instances of VS at the same time?
Nope, it is not documented, but it is used. For instance for integration with Application Insights profiler. This provider: Microsoft-ApplicationInsights-Data exposes events in the form very close to debug output JSON. I believe intelliTrace is using ETW and my assumption was that they have solved all problems you mentioned.
However, you know Visual Studio and all scenarios better than me. So if the feature of hiding strings from Output window is more viable - I'm all for it!
Thank you for looking into it again.
Any updates? Is there a workaround, like a way to filter the debug window contents or something ..?