Beispiel #1
0
        public MetricsDeclarationBuilder WithWebAppMetric(string metricName                 = "promitor-web-app",
                                                          string metricDescription          = "Description for a metric",
                                                          string webAppName                 = "promitor-web-app-name",
                                                          string slotName                   = "production",
                                                          string azureMetricName            = "Total",
                                                          string resourceDiscoveryGroupName = "",
                                                          bool omitResource                 = false)
        {
            var resource = new WebAppResourceV1
            {
                WebAppName = webAppName,
                SlotName   = slotName
            };

            CreateAndAddMetricDefinition(ResourceType.WebApp, metricName, metricDescription, resourceDiscoveryGroupName, omitResource, azureMetricName, resource);

            return(this);
        }
        public MetricsDeclarationBuilder WithWebAppMetric(string metricName = "promitor-web-app", string metricDescription = "Description for a metric", string webAppName = "promitor-web-app-name", string slotName = "production", string azureMetricName = "Total")
        {
            var azureMetricConfiguration = CreateAzureMetricConfiguration(azureMetricName);
            var resource = new WebAppResourceV1
            {
                WebAppName = webAppName,
                SlotName   = slotName
            };

            var metric = new MetricDefinitionV1
            {
                Name        = metricName,
                Description = metricDescription,
                AzureMetricConfiguration = azureMetricConfiguration,
                Resources = new List <AzureResourceDefinitionV1> {
                    resource
                },
                ResourceType = ResourceType.WebApp
            };

            _metrics.Add(metric);

            return(this);
        }