简体   繁体   English

Azure存储帐户指标仅对经典存储帐户可见

[英]Azure Storage Account Metrics only visible for Classic Storage Account

I've tested creating both classic storage account ( manage.windowsazure.com ) and a "new" storage account in the new Azure Portal. 我已经测试了在新的Azure门户中创建经典存储帐户( manage.windowsazure.com )和“新”存储帐户。 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. 我已经设置了这样的ServiceProperties,并且可以在获取服务属性或查看Azure门户时成功查看这些更改。

        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. 当我使用Microsoft Azure存储资源管理器时,两个帐户都有用于度量和日志设置的表,因此两者都是这样的,并且表包含数据。 So from here it looks similar. 所以从这里看起来很相似。 But the metrics graphs and options are only available for the Classic Storage account in Azure Portal. 但度量标准图和选项仅适用于Azure门户中的Classic Storage帐户。 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 Microsoft Azure Storage Explorer的屏幕截图

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: 根据您的代码设置,我利用WindowsAzure.Storage(版本7.2.1)在经典存储帐户和新存储帐户上配置我的存储帐户指标,如下所示:

    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. 在代码段中,您可以配置Blob存储的分钟/小时指标。

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: 由于您已确认相关表包含度量标准记录,因此您可以尝试登录Azure门户,选择存储帐户,单击“队列服务”>“度量标准”,单击“编辑图表”并更改“时间范围”,如下所示:

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. 可能存在数据延迟,您可以尝试指定时间范围,并确定是否可以按预期检索指标数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM