CompetelyDisableMetrics is broken
o-mdr opened this issue · comments
Oleksii Mandrychenko commented
I cannot disable metrics and suspect its a bug. Steps to reproduce:
- Set
Metrics.Central
as a startup project - Insert
<add key="Metrics.CompetelyDisableMetrics" value="true"/>
into config file - Run in Visual Studio
Code throws a NRE at line 251 of MetricsConfig.cs
private static bool ConfigureMetricsEnabledDisabled()
{
try
{
var isDisabled = ConfigurationManager.AppSettings["Metrics.CompetelyDisableMetrics"];
if (!string.IsNullOrEmpty(isDisabled) && isDisabled.ToUpperInvariant() == "TRUE")
{
>>>> Metric.Advanced.CompletelyDisableMetrics(); // <<<<< HERE Advanced is null
log.Info(() => "Metrics: [...]");
return true;
}
return false;
}
catch (Exception x)
{
log.ErrorException("Metrics: Error disabling metrics library", x);
throw new InvalidOperationException("Invalid Metrics[...]", x);
}
}
Iulian Margarintescu commented
Fixed in dev, will be on nuget by Monday.
Thanks.