Esempio n. 1
0
        protected virtual ICollector <IGauge> CreateRequestsInProgressGauge()
        {
            string[] defaultLabels = new[] { "operation" };

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

            _options.ConfigureRequestsInProgressGauge?.Invoke(configuration);

            if (configuration.LabelNames != defaultLabels)
            {
                throw new ArgumentException("The requests in progress gauge configuration is missing the required default labels");
            }

            return(_metrics.CreateGauge("http_server_requests_in_progress", "The number of HTTP requests currently being processed by the application", configuration));
        }