Instrumenting windows service with Application Insights

断了今生、忘了曾经 提交于 2020-01-21 17:24:08

问题


Is it possible to instrument a windows service running on premise with Application Insights? It's not necessary to have it automatically collecting metrics of the application like it does with Web applications, pushing custom events to Azure would suffice.


回答1:


I'll make the docs a bit more clear on this. You can instrument anything if there's a core SDK that will build with it. So any kind of .NET, Java, PHP, OSX, iOS, Android, .... If you want additional modules that log web requests, crashes, etc, you're a little bit more restricted.

For Windows Services on premises, follow what you see here: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-windows-desktop




回答2:


Install Core SDK nuget. Then create TelemetryClient, set instrumentation key programmatically and start sending telemetry from places you want. Msdn article describes how to use AI API. There will be no autocollection but everything should work.




回答3:


This totally possible! Quoting the Application Insights web page:

Monitor ASP.NET or J2EE web apps hosted anywhere: on Azure, or on other cloud services, or your own on-premises servers

You just need to create an instrumentation key on the Azure Portal and integrate the matching SDK into your app. Then the actual telemetry data is sent to the backend servers which are hosted as part of Azure.



来源:https://stackoverflow.com/questions/30704977/instrumenting-windows-service-with-application-insights

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!