-
Dear Roslyn team, I would like to know if there is a standard way to collect telemetry in Roslyn analyzers. In particular, I want to collect the number of errors found by my diagnostics on the developer machines. This can be useful to advocate for benefits brought by the static code analysis and show its impact on the code quality. I didn't manage to find any documented approach to this task. Is there standard mechanism to collect telemetry from Roslyn analyzers? It is also fine to use Visual Studio telemetry mechanisms, if they can be used from VS extensions. Although it would be a little worse, since the scenario where analyzers are added to a project as a Nuget package won't be supported. Still, it is better than nothing. If you know a way to collect telemetry from the Roslyn analyzer, or a VS extension that does this, please share it with me. Ideally, a code example with the collection logic. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
There is no built-in mechanism for this for VS extension developers as far as I'm aware, and even if there were, analyzers could not take advantage of such an API, as they cannot depend on any VS APIs and cannot do any form of manual IO. There's nothing built-in for this, you'd have to write some sort of VS extension that collects and reports this info as you choose. |
Beta Was this translation helpful? Give feedback.
-
Hi @333fred. Thank you for your answer. I was hoping that there was something I can use in the Unfortunately, there is no documentation about it. Is it not intended to be used by extension developers? |
Beta Was this translation helpful? Give feedback.
-
@333fred thank you very much for the clarification! |
Beta Was this translation helpful? Give feedback.
There is no built-in mechanism for this for VS extension developers as far as I'm aware, and even if there were, analyzers could not take advantage of such an API, as they cannot depend on any VS APIs and cannot do any form of manual IO. There's nothing built-in for this, you'd have to write some sort of VS extension that collects and reports this info as you choose.