forked from prometheus-net/prometheus-net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Global.asax.cs
32 lines (29 loc) · 1.14 KB
/
Global.asax.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Prometheus;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
// This sample demonstrates how to integrate prometheus-net into a .NET Framework web app.
//
// NuGet packages required:
// * prometheus-net.NetFramework.AspNet
namespace Sample.Web.NetFramework
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
// Enable the /metrics page to export Prometheus metrics.
// Open http://localhost:xxxx/metrics to see the metrics.
//
// Metrics published in this sample:
// * built-in process metrics giving basic information about the .NET runtime (enabled by default)
AspNetMetricServer.RegisterRoutes(GlobalConfiguration.Configuration);
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}