public MetricsDeclarationBuilder WithServiceBusMetric(string metricName = "promitor-service-bus", string metricDescription = "Description for a metric", string metricDimension = "", string queueName = "promitor-queue", string serviceBusNamespace = "promitor-namespace", string azureMetricName = "Total", bool omitResource = false) { var azureMetricConfiguration = CreateAzureMetricConfiguration(azureMetricName, metricDimension); var resource = new ServiceBusQueueResourceV1 { QueueName = queueName, Namespace = serviceBusNamespace }; var metric = new MetricDefinitionV1 { Name = metricName, Description = metricDescription, AzureMetricConfiguration = azureMetricConfiguration, ResourceType = ResourceType.ServiceBusQueue }; if (omitResource == false) { metric.Resources = new List <AzureResourceDefinitionV1> { resource }; } _metrics.Add(metric); return(this); }
public MetricsDeclarationBuilder WithServiceBusMetric(string metricName = "promitor-service-bus", string metricDescription = "Description for a metric", string metricDimension = "", string queueName = "promitor-queue", string serviceBusNamespace = "promitor-namespace", string azureMetricName = "Total", string resourceDiscoveryGroupName = "", bool omitResource = false) { var resource = new ServiceBusQueueResourceV1 { QueueName = queueName, Namespace = serviceBusNamespace }; CreateAndAddMetricDefinition(ResourceType.ServiceBusQueue, metricName, metricDescription, resourceDiscoveryGroupName, omitResource, azureMetricName, resource, metricDimension); return(this); }
public MetricsDeclarationBuilder WithServiceBusMetric(string metricName = "promitor-service-bus", string metricDescription = "Description for a metric", string metricDimension = "", string queueName = "promitor-queue", string serviceBusNamespace = "promitor-namespace", string azureMetricName = "Total", string resourceDiscoveryGroupName = "", bool omitResource = false, List <string> queueNames = null, Dictionary <string, string> labels = null) { var serviceBusQueueResources = new List <AzureResourceDefinitionV1>(); if (queueNames != null) { foreach (string queue in queueNames) { var resource = new ServiceBusQueueResourceV1 { QueueName = queue, Namespace = serviceBusNamespace }; serviceBusQueueResources.Add(resource); } } else { var resource = new ServiceBusQueueResourceV1 { QueueName = queueName, Namespace = serviceBusNamespace }; serviceBusQueueResources.Add(resource); } CreateAndAddMetricDefinition(ResourceType.ServiceBusQueue, metricName, metricDescription, resourceDiscoveryGroupName, omitResource, azureMetricName, serviceBusQueueResources, metricDimension, labels); return(this); }