Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an example to implement App.Metrics in ASP.NET Web API (not .net core)?

I'm updating a ASP.NET Web API (.Net Framework 4.6.2) to include metrics using App.Metric nugets provided by the site below:

https://www.app-metrics.io/

Tried to run in a console app provided by the github site:

https://github.com/AppMetrics/Samples.V2

To make it work I had to do the following:

  1. Remove all Nugets related to App.Metric from the solution
  2. Remove all assemblies related to App.Metric
  3. Add again the App.Metric nugets

Again, its easy to do in a console but I want an out-of-the-box generated endpoints similar to the Asp.Net Core examples.. is it possible to do the same with ASP.NET Web API framework version?

like image 538
deeproute Avatar asked Apr 11 '19 19:04

deeproute


1 Answers

You need to install App.Metrics.Extensions.Owin.WebApi nuget package and the follow this sample code to enable it on WebApi.

like image 103
Kahbazi Avatar answered Oct 18 '22 10:10

Kahbazi