Ejemplo n.º 1
0
        protected virtual ICollector <ICounter> CreateErrorTotalCounter()
        {
            string[] defaultLabels = new[] { "operation", "sli_error_type", "sli_dependency" };

            var configuration = new CounterConfiguration
            {
                SuppressInitialValue = true,
                LabelNames           = defaultLabels
            };

            _options.ConfigureErrorTotalCounter?.Invoke(configuration);

            if (configuration.LabelNames != defaultLabels)
            {
                throw new ArgumentException("The error total counter configuration is missing the required default labels");
            }

            return(_metrics.CreateCounter("http_server_errors_total", "The number of HTTP requests resulting in an error", configuration));
        }