Application Insights in Service Fabric?

余生颓废 提交于 2019-12-02 00:54:41

The NuGet package is located here: https://www.nuget.org/packages/Microsoft.ServiceFabric.Telemetry.ApplicationInsights/

Make sure to configure your search to include "Prerelease" packages.

You're likely looking for the updated GitHub repository at https://github.com/Microsoft/ApplicationInsights-ServiceFabric. This lists two NuGet packages to use depending on your use case:

Peter Bons

We did come up with our own integration including support for dependency tracking and Live Metrics Stream.

Basically what you need to do is manually adding the required dependency and performance collectors of Application Insights to your application like this:

        var configuration = new TelemetryConfiguration()         {             InstrumentationKey = aiKey         };          var module = new DependencyTrackingTelemetryModule();         module.Initialize(configuration);          QuickPulseTelemetryProcessor processor = null;          configuration.TelemetryProcessorChainBuilder             .Use(next =>             {                 processor = new QuickPulseTelemetryProcessor(next);                 return processor;             })             .Build();          var quickPulse = new QuickPulseTelemetryModule();         quickPulse.Initialize(configuration);         quickPulse.RegisterTelemetryProcessor(processor); 

Then to log and correlate requests of your frontend services and your backend stateful/stateless services you will need to intercept calls to the SF services based on the directions of this post: How to add message header to the request when using default client of Azure service fabric?

Web Api requests can be logged to Application Insights using some custom Middleware, that is not too hard to write.

We have created a code repository that outlines a working example that can be found here at https://github.com/DeHeerSoftware/Azure-Service-Fabric-Logging-And-Monitoring

It is quite a lot of code to integrate everything so please take a look at the provided repository. It will give you a starting point.

The package can still be installed using Package Manager Console:

Install-Package Microsoft.ServiceFabric.Telemetry.ApplicationInsights  -Pre -Version 0.3.193-preview2  

However, see the important note "The owner has unlisted this package. This could mean that the package is deprecated or shouldn't be used anymore."

https://www.nuget.org/packages/Microsoft.ServiceFabric.Telemetry.ApplicationInsights/

It looks like it's still very early days on this integration. Additionally all it currently does is route ETW events through to App Insights.

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