예제 #1
0
 public MetricDefinition(PrometheusMetricDefinition prometheusMetricDefinition,
                         Scraping scraping,
                         AzureMetricConfiguration azureMetricConfiguration,
                         ResourceType resourceType,
                         List <IAzureResourceDefinition> resources)
 {
     AzureMetricConfiguration   = azureMetricConfiguration;
     PrometheusMetricDefinition = prometheusMetricDefinition;
     Scraping     = scraping;
     ResourceType = resourceType;
     Resources    = resources;
 }
예제 #2
0
        /// <summary>
        /// Creates a new instance of the <see cref="ScrapeDefinition{TResourceDefinition}"/> class.
        /// </summary>
        /// <param name="azureMetricConfiguration">Configuration about the Azure Monitor metric to scrape</param>
        /// <param name="prometheusMetricDefinition">The details of the prometheus metric that will be created.</param>
        /// <param name="scraping">The scraping model.</param>
        /// <param name="resource">The resource to scrape.</param>
        /// <param name="resourceGroupName">
        /// The name of the resource group containing the resource to scrape. This should contain the global
        /// resource group name if none is overridden at the resource level.
        /// </param>
        public ScrapeDefinition(
            AzureMetricConfiguration azureMetricConfiguration,
            PrometheusMetricDefinition prometheusMetricDefinition,
            Scraping scraping,
            TResourceDefinition resource,
            string resourceGroupName)
        {
            Guard.NotNull(azureMetricConfiguration, nameof(azureMetricConfiguration));
            Guard.NotNull(prometheusMetricDefinition, nameof(prometheusMetricDefinition));
            Guard.NotNull(scraping, nameof(scraping));
            Guard.NotNull(resource, nameof(resource));
            Guard.NotNull(resourceGroupName, nameof(resourceGroupName));

            AzureMetricConfiguration   = azureMetricConfiguration;
            PrometheusMetricDefinition = prometheusMetricDefinition;
            Scraping          = scraping;
            Resource          = resource;
            ResourceGroupName = resourceGroupName;
        }