1
votes

I've tested creating both classic storage account (manage.windowsazure.com) and a "new" storage account in the new Azure Portal. Set them up similar and run the same code to create and configure a queue. But metrics is only showing for the classic storage account in the Portal (Able to see both accounts in the new Portal)

I have set up the ServiceProperties like this, and can successfully see these changes saved when fetching service properties or looking in the Azure Portal.

        CloudStorageAccount storageAccount =
                CloudStorageAccount.parse(storageConnectionString);

        CloudQueueClient queueClient = storageAccount.createCloudQueueClient();

        MetricsProperties metricsProperties = new MetricsProperties();
        metricsProperties.setMetricsLevel(MetricsLevel.SERVICE_AND_API);
        metricsProperties.setRetentionIntervalInDays(2);

        LoggingProperties loggingProperties = new LoggingProperties();
        loggingProperties.setRetentionIntervalInDays(10);
        loggingProperties.setLogOperationTypes(EnumSet.of(LoggingOperations.READ, LoggingOperations.WRITE, LoggingOperations.DELETE));


        ServiceProperties serviceProperties = new ServiceProperties();
        serviceProperties.setHourMetrics(metricsProperties);
        serviceProperties.setMinuteMetrics(metricsProperties);
        serviceProperties.setLogging(loggingProperties);

        queueClient.uploadServiceProperties(serviceProperties);

When I use Microsoft Azure Storage Explorer both accounts has the tables for metrics and logging set up, so both look like this and the tables contains data. So from here it looks similar. But the metrics graphs and options are only available for the Classic Storage account in Azure Portal. For the "new" Storage account it only says "No available data".

Is it a bug? Or is a classic Storage Account default configured with some properties I manually need to apply to the new Storage account to make it behave similar?

Screenshot from Microsoft Azure Storage Explorer

1
Any updates, have you solved this issue?Bruce Chen

1 Answers

0
votes

According to your code setting, I leverage WindowsAzure.Storage (version 7.2.1) to configure my storage account metrics both on the classic Storage Account and the new Storage Account as follows:

    var blobClient = storageAccount.CreateCloudBlobClient();

    MetricsProperties metricsProperties = new MetricsProperties();
    metricsProperties.MetricsLevel = MetricsLevel.ServiceAndApi;
    metricsProperties.RetentionDays = 2;

    LoggingProperties loggingProperties = new LoggingProperties();
    loggingProperties.RetentionDays = 10;
    loggingProperties.LoggingOperations = LoggingOperations.Read | LoggingOperations.Write | LoggingOperations.Delete;


    ServiceProperties serviceProperties = new ServiceProperties();
    serviceProperties.HourMetrics=metricsProperties;
    serviceProperties.MinuteMetrics=metricsProperties;
    serviceProperties.Logging=loggingProperties;

    blobClient.SetServiceProperties(serviceProperties);

Upon the code snippet, you could configure the minute/hour metrics for your Blob Storage.

Since you have confirmed that the related tables contain metric records, you could try to log into the Azure Portal, choose your storage account, click QUEUE SERVICE > Metrics, click Edit chart and change the Time Range as follows:

Note: The time range is set to today by default if there has any metric records. There could be data latency, you could try to specify the time range and find out whether you could retrieve your metrics data as you expected.