Ejemplo n.º 1
0
        public MetricScrapingJob(ScrapeDefinition <AzureResourceDefinition> metric,
                                 IMetricsDeclarationProvider metricsDeclarationProvider,
                                 IPrometheusMetricWriter prometheusMetricWriter,
                                 IRuntimeMetricsCollector runtimeMetricsCollector,
                                 MetricScraperFactory metricScraperFactory,
                                 ILogger logger, IExceptionTracker exceptionTracker)
        {
            Guard.NotNull(metric, nameof(metric));
            Guard.NotNull(metricsDeclarationProvider, nameof(metricsDeclarationProvider));
            Guard.NotNull(prometheusMetricWriter, nameof(prometheusMetricWriter));
            Guard.NotNull(runtimeMetricsCollector, nameof(runtimeMetricsCollector));
            Guard.NotNull(metricScraperFactory, nameof(metricScraperFactory));
            Guard.NotNull(logger, nameof(logger));
            Guard.NotNull(exceptionTracker, nameof(exceptionTracker));

            _metric = metric;
            _metricsDeclarationProvider = metricsDeclarationProvider;
            _prometheusMetricWriter     = prometheusMetricWriter;
            _runtimeMetricsCollector    = runtimeMetricsCollector;
            _exceptionTracker           = exceptionTracker;
            _logger = logger;

            _metricScraperFactory = metricScraperFactory;

            ConfigureJob();
        }
Ejemplo n.º 2
0
        public PrometheusScrapingEndpointMetricSink(IMetricsDeclarationProvider metricsDeclarationProvider, IOptionsMonitor <PrometheusScrapingEndpointSinkConfiguration> prometheusConfiguration, ILogger <PrometheusScrapingEndpointMetricSink> logger)
        {
            Guard.NotNull(prometheusConfiguration, nameof(prometheusConfiguration));
            Guard.NotNull(logger, nameof(logger));

            _metricsDeclarationProvider = metricsDeclarationProvider;
            _prometheusConfiguration    = prometheusConfiguration;
            _logger = logger;
        }
Ejemplo n.º 3
0
        public AzureScrapingPrometheusMetricsCollector(IMetricsDeclarationProvider metricsDeclarationProvider, IPrometheusMetricsCollector prometheusMetricsCollector, IOptionsMonitor <PrometheusScrapingEndpointSinkConfiguration> prometheusConfiguration)
        {
            Guard.NotNull(metricsDeclarationProvider, nameof(metricsDeclarationProvider));
            Guard.NotNull(prometheusMetricsCollector, nameof(prometheusMetricsCollector));

            _prometheusConfiguration    = prometheusConfiguration;
            _prometheusMetricsCollector = prometheusMetricsCollector;
            _metricsDeclarationProvider = metricsDeclarationProvider;
        }
Ejemplo n.º 4
0
        public MetricScrapingJob(IMetricsDeclarationProvider metricsDeclarationProvider, ILogger logger, IExceptionTracker exceptionTracker)
        {
            Guard.NotNull(metricsDeclarationProvider, nameof(metricsDeclarationProvider));
            Guard.NotNull(exceptionTracker, nameof(exceptionTracker));
            Guard.NotNull(logger, nameof(logger));

            _metricsDeclarationProvider = metricsDeclarationProvider;
            _exceptionTracker           = exceptionTracker;
            _logger = logger;

            ConfigureJob();
        }
Ejemplo n.º 5
0
        public ConfigurationController(IOptionsMonitor <ScraperRuntimeConfiguration> runtimeConfiguration, IMetricsDeclarationProvider metricsDeclarationProvider)
        {
            _runtimeConfiguration       = runtimeConfiguration;
            _metricsDeclarationProvider = metricsDeclarationProvider;

            _serializerSettings = new JsonSerializerSettings
            {
                NullValueHandling = NullValueHandling.Ignore,
                TypeNameHandling  = TypeNameHandling.Objects
            };
            _serializerSettings.Converters.Add(new StringEnumConverter());
        }
Ejemplo n.º 6
0
        public RuntimeValidator(
            IOptions <MetricsConfiguration> metricsConfiguration,
            ILogger <RuntimeValidator> validatorLogger,
            IMetricsDeclarationProvider scrapeConfigurationProvider,
            IConfiguration configuration)
        {
            _validationLogger = validatorLogger;

            _validationSteps = new List <IValidationStep>
            {
                new ConfigurationPathValidationStep(metricsConfiguration, _validationLogger),
                new AzureAuthenticationValidationStep(configuration, _validationLogger),
                new MetricsDeclarationValidationStep(scrapeConfigurationProvider, _validationLogger)
            };
        }
Ejemplo n.º 7
0
        public MetricScrapingJob(MetricDefinition metric,
                                 IMetricsDeclarationProvider metricsDeclarationProvider,
                                 IRuntimeMetricsCollector runtimeMetricsCollector,
                                 ILogger logger, IExceptionTracker exceptionTracker)
        {
            Guard.NotNull(metric, nameof(metric));
            Guard.NotNull(exceptionTracker, nameof(exceptionTracker));
            Guard.NotNull(logger, nameof(logger));

            _metric = metric;
            _metricsDeclarationProvider = metricsDeclarationProvider;
            _runtimeMetricsCollector    = runtimeMetricsCollector;
            _exceptionTracker           = exceptionTracker;
            _logger = logger;

            ConfigureJob();
        }
Ejemplo n.º 8
0
        public RuntimeValidator(
            IOptions <ScraperRuntimeConfiguration> runtimeConfiguration,
            IOptions <MetricsConfiguration> metricsConfiguration,
            ILogger <RuntimeValidator> validatorLogger,
            IMetricsDeclarationProvider scrapeConfigurationProvider,
            IConfiguration configuration)
        {
            _validationLogger = validatorLogger;

            _validationSteps = new List <IValidationStep>
            {
                new ConfigurationPathValidationStep(metricsConfiguration, _validationLogger),
                new AzureAuthenticationValidationStep(configuration, _validationLogger),
                new MetricsDeclarationValidationStep(scrapeConfigurationProvider, _validationLogger),
                new ResourceDiscoveryValidationStep(runtimeConfiguration.Value.ResourceDiscovery, _validationLogger),
                new StatsDMetricSinkValidationStep(runtimeConfiguration, _validationLogger),
                new PrometheusScrapingEndpointMetricSinkValidationStep(runtimeConfiguration, _validationLogger)
            };
        }
Ejemplo n.º 9
0
        public MetricScrapingJob(ScrapeDefinition <IAzureResourceDefinition> metric,
                                 IMetricsDeclarationProvider metricsDeclarationProvider,
                                 IPrometheusMetricWriter prometheusMetricWriter,
                                 MetricScraperFactory metricScraperFactory,
                                 AzureMonitorClient azureMonitorClient,
                                 ILogger <MetricScrapingJob> logger)
        {
            Guard.NotNull(metric, nameof(metric));
            Guard.NotNull(metricsDeclarationProvider, nameof(metricsDeclarationProvider));
            Guard.NotNull(prometheusMetricWriter, nameof(prometheusMetricWriter));
            Guard.NotNull(metricScraperFactory, nameof(metricScraperFactory));
            Guard.NotNull(azureMonitorClient, nameof(azureMonitorClient));
            Guard.NotNull(logger, nameof(logger));

            _metric = metric;
            _metricsDeclarationProvider = metricsDeclarationProvider;
            _prometheusMetricWriter     = prometheusMetricWriter;
            _logger = logger;

            _metricScraperFactory = metricScraperFactory;
            _azureMonitorClient   = azureMonitorClient;
            ConfigureJob();
        }
Ejemplo n.º 10
0
 public MetricsDeclarationValidationStep(IMetricsDeclarationProvider metricsDeclarationProvider, ILogger <MetricsDeclarationValidationStep> logger) : base(logger)
 {
     _metricsDeclarationProvider = metricsDeclarationProvider;
 }
Ejemplo n.º 11
0
 public ConfigurationController(IOptionsMonitor <RuntimeConfiguration> runtimeConfiguration, IMetricsDeclarationProvider metricsDeclarationProvider)
 {
     _runtimeConfiguration       = runtimeConfiguration;
     _metricsDeclarationProvider = metricsDeclarationProvider;
 }
 public MetricsDeclarationValidationStep(IMetricsDeclarationProvider metricsDeclarationProvider) : this(metricsDeclarationProvider, NullLogger.Instance)
 {
 }
Ejemplo n.º 13
0
        public MetricsTableGenerator(IMetricsDeclarationProvider metricsDeclarationProvider)
        {
            Guard.NotNull(metricsDeclarationProvider, nameof(metricsDeclarationProvider));

            _metricsDeclarationProvider = metricsDeclarationProvider;
        }
Ejemplo n.º 14
0
 public ConfigurationController(IMetricsDeclarationProvider metricsDeclarationProvider)
 {
     _metricsDeclarationProvider = metricsDeclarationProvider;
 }
Ejemplo n.º 15
0
 public AtlassianStatuspageMetricSinkValidationStep(IOptions <ScraperRuntimeConfiguration> runtimeConfiguration, IMetricsDeclarationProvider metricsDeclarationProvider, ILogger <AtlassianStatuspageMetricSinkValidationStep> validationLogger)
     : base(validationLogger)
 {
     _runtimeConfiguration       = runtimeConfiguration;
     _metricsDeclarationProvider = metricsDeclarationProvider;
 }
 public ResourceDiscoveryValidationStep(IOptions <ResourceDiscoveryConfiguration> resourceDiscoveryResourceDiscoveryConfiguration, IMetricsDeclarationProvider metricsDeclarationProvider, ILogger <ResourceDiscoveryValidationStep> logger) : base(logger)
 {
     _metricsDeclarationProvider     = metricsDeclarationProvider;
     _resourceDiscoveryConfiguration = resourceDiscoveryResourceDiscoveryConfiguration;
 }
 public AzureMonitorScrapingTask(IMetricsDeclarationProvider metricsDeclarationProvider)
 {
     this.metricsDeclarationProvider = metricsDeclarationProvider;
 }
Ejemplo n.º 18
0
 public AzureMonitorScrapingTask(IMetricsDeclarationProvider metricsDeclarationProvider, ILogger logger, IExceptionTracker exceptionTracker)
 {
     _metricsDeclarationProvider = metricsDeclarationProvider;
     _logger           = logger;
     _exceptionTracker = exceptionTracker;
 }
Ejemplo n.º 19
0
 public MetricsDeclarationValidationStep(IMetricsDeclarationProvider metricsDeclarationProvider)
 {
     this.metricsDeclarationProvider = metricsDeclarationProvider;
 }