static Metric() { globalContext = new DefaultMetricsContext(GetGlobalContextName()); if (MetricsConfig.GloballyDisabledMetrics) { globalContext.CompletelyDisableMetrics(); log.Info(() => "Metrics: Metrics.NET Library is completely disabled. Set Metrics.CompletelyDisableMetrics to false to re-enable."); } config = new MetricsConfig(globalContext); config.ApplySettingsFromConfigFile(); }
static Metric() { globalContext = new DefaultMetricsContext(GetGlobalContextName()); if (MetricsConfig.GlobalyDisabledMetrics) { globalContext.CompletelyDisableMetrics(); log.Info(() => "Metrics: Metrics.NET Library is completely disabled. Set Metrics.CompetelyDisableMetrics to false to re-enable."); } config = new MetricsConfig(globalContext); config.ApplySettingsFromConfigFile(); }
private static MetricsConfig InitConfig(string context) { globalContext = new DefaultMetricsContext(context); if (MetricsConfig.GloballyDisabledMetrics) { globalContext.CompletelyDisableMetrics(); log.Info(() => "Metrics: Metrics.NET Library is completely disabled. Set Metrics.CompletelyDisableMetrics to false to re-enable."); } config = new MetricsConfig(globalContext); config.ApplySettingsFromConfigFile(); return(config); }
static Metric() { ConfigurationManager.Build(builder => { builder.AddJsonFile("appsettings.json", true, true) .AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", true, true) .Build(); }); globalContext = new DefaultMetricsContext(GetGlobalContextName()); if (MetricsConfig.GloballyDisabledMetrics) { globalContext.CompletelyDisableMetrics(); log.Info(() => "Metrics: Metrics.NET Library is completely disabled. Set Metrics.CompletelyDisableMetrics to false to re-enable."); } config = new MetricsConfig(globalContext); config.ApplySettingsFromConfigFile(); }
static Metric() { globalContext = new DefaultMetricsContext(MetricsConfig.GetGlobalContextName()); config = new MetricsConfig(globalContext); config.ApplySettingsFromConfigFile(); }