コード例 #1
0
        public MetricsDeclarationBuilder WithCosmosDbMetric(string metricName                 = "promitor-cosmosdb",
                                                            string metricDescription          = "Description for a metric",
                                                            string dbName                     = "promitor-cosmosdb",
                                                            string azureMetricName            = "TotalRequests",
                                                            string resourceDiscoveryGroupName = "",
                                                            bool omitResource                 = false)
        {
            var resource = new CosmosDbResourceV1
            {
                DbName = dbName
            };

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

            return(this);
        }
コード例 #2
0
        public MetricsDeclarationBuilder WithCosmosDbMetric(string metricName = "promitor-cosmosdb", string metricDescription = "Description for a metric", string dbName = "promitor-cosmosdb", string azureMetricName = "TotalRequests")
        {
            var azureMetricConfiguration = CreateAzureMetricConfiguration(azureMetricName);
            var resource = new CosmosDbResourceV1
            {
                DbName = dbName
            };

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

            _metrics.Add(metric);

            return(this);
        }