コード例 #1
0
        public MetricsDeclarationBuilder WithSqlManagedInstanceMetric(
            string metricName        = "promitor-sql-managed-instance",
            string azureMetricName   = "cpu_percent",
            string instanceName      = "promitor-sql-instance",
            string metricDescription = "Metric description")
        {
            var azureMetricConfiguration = CreateAzureMetricConfiguration(azureMetricName);
            var resource = new SqlManagedInstanceResourceV1
            {
                InstanceName = instanceName
            };

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

            _metrics.Add(metric);

            return(this);
        }
コード例 #2
0
        public MetricsDeclarationBuilder WithSqlManagedInstanceMetric(
            string metricName                 = "promitor-sql-managed-instance",
            string azureMetricName            = "cpu_percent",
            string instanceName               = "promitor-sql-instance",
            string metricDescription          = "Metric description",
            string resourceDiscoveryGroupName = "",
            bool omitResource                 = false)
        {
            var resource = new SqlManagedInstanceResourceV1
            {
                InstanceName = instanceName
            };

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

            return(this);
        }