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.
I didn’t manage to find any solution to this problem. 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.
UPDATE
Dear Stack Overflow moderators reading this question and reviewing.
I already see your hands moving to raise a flag about “Seeking recommendation” guideline. Before you do this to get your daily doze of endorphin to feel good about “maintaining questions quality” and “community values”, please at least try looking for this area yourself.
This subject is a narrow area and I did my googling. It’s not like I’m asking a general guidance on C# best practices or best telemetry library, or git branching strategies, or whatever. There is little info on this topic, and I’m not sure where I should even start looking. I’m also unsure where should else I ask.
If I missed something, shame on me, please share the link before closing the question without any remark. Or even make it an answer. I would be really grateful, as well as other people that may look for this topic. It’s not so hard to imagine other analyzer authors interested in collecting telemetry.
However, I believe it is not that simple to provide an answer that’s why I asked this question in the first place. Perhaps, it is not even your area of expertise, and you just saw the word “recommend” or “advise”. I know how the review works with its gamification system and scores for the helpful flags and etc.
I still believe that my question could bring some benefit not only to me but to other people.