pyrevitlabs/pyRevit

Write Application Telemetry to JSON file

kwandrew2 opened this issue · 4 comments

Is your feature request related to a problem? Please describe

It may be possible and I'm just missing a setting but we currently write our script telemetry data to JSON files and would like to do the same with Application Telemetry.

Describe the solution you'd like

I'd like to save application telemetry data to JSON files. We use power BI to visualize pyRevit tool usage (from the JSON files) and would like to use the same process for application telemetry.

Describe alternatives you've considered

I requested our IT team setup a application telemetry server or API endpoint and they made this process seem prohibitive because of the effort/time investment it'd take.

Additional context

If writing application telemetry to JSON is already possible please let me know and I can put this to rest. If it's not possible to write Application Telemetry data to JSON files, adding a note next to those sections in the pyRevit settings could potentially save others on these efforts.

Thanks in advance!

Hi @kwandrew2 ,
have you tried this?
image

Hi @sanzoghenzo
Yes that’s what I’m currently using for commands but it doesn’t seem to write hook/event data to the json, only the commands.

Thanks for the clarification, I admin I don't use telemetry (yet) and I didn't know the difference between script and application telemetry 😅

To write the application telemetry to the same json file it would be enough to copy over 3 lines of code from here to here.

You can already try it on you local copy (files are in %appdata%\pyRevit-Master\ if you installed it as a single user), but I'm not sure if there were any reason to left it out; tomorrow at the online meeting we could discuss it along with my proposal: to get rid of our custom telemetry server and use OpenTelemetry, so that one can use the server and visualization app of his/her choice (Jaeger and zipkin are two open source options, among others - you IT would just need a linux box with docker to spin up a server...)

Thank you for the assistance! I ended up playing around with hooks a bit and enlisted the help of one of my coworkers to get project times written to a file. I’m waiting on the end product yet but truly appreciate the assistance and may end up giving what you sent a shot if we run into any issues.