예제 #1
0
 /// <summary>
 /// this is used in web host
 /// </summary>
 /// <param name="app"></param>
 /// <param name="settings"></param>
 public static void AddPrometheus(this IApplicationBuilder app,
                                  PrometheusSettings settings)
 {
     app.UsePrometheusServer(options =>
     {
         options.UseDefaultCollectors = true;
         options.MapPath = settings.Route;
     });
 }
예제 #2
0
        /// <summary>
        /// this is used in web host
        /// </summary>
        /// <param name="app"></param>
        /// <param name="configuration"></param>
        public static void UsePrometheus(this IApplicationBuilder app, IConfiguration configuration)
        {
            var settings = new PrometheusSettings();

            configuration.Bind(nameof(PrometheusSettings), settings);

            app.UsePrometheusServer(options =>
            {
                options.UseDefaultCollectors = true;
                options.MapPath = settings.Route;
            });
        }