【问题标题】:Azure Storage Account Metrics only visible for Classic Storage AccountAzure 存储帐户指标仅对经典存储帐户可见
【发布时间】:2017-03-24 04:58:24
【问题描述】:

我已经测试了在新的 Azure 门户中创建经典存储帐户 (manage.windowsazure.com) 和“新”存储帐户。设置它们类似并运行相同的代码来创建和配置队列。但指标仅显示门户中的经典存储帐户(能够在新门户中查看两个帐户)

我已经像这样设置了 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);

当我使用 Microsoft Azure 存储资源管理器时,两个帐户都设置了指标表和日志记录,因此两者看起来都像这样,并且表中包含数据。 所以从这里看起来很相似。但指标图表和选项仅适用于 Azure 门户中的经典存储帐户。对于“新”存储帐户,它只显示“无可用数据”。

这是一个错误吗?还是经典存储帐户默认配置了一些我需要手动应用到新存储帐户以使其行为相似的属性?

Screenshot from Microsoft Azure Storage Explorer

【问题讨论】:

  • 任何更新,你解决了这个问题吗?

标签: azure azure-storage azure-storage-queues


【解决方案1】:

根据您的代码设置,我利用 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);

在代码 sn-p 上,您可以为 Blob 存储配置分钟/小时指标。

由于您已确认相关表包含指标记录,您可以尝试登录 Azure Portal,选择您的存储帐户,单击 QUEUE SERVICE > Metrics,单击 Edit chart 并更改 Time Range,如下所示:

注意:如果有指标记录,时间范围默认设置为今天。可能存在数据延迟,您可以尝试指定时间范围并确定是否可以按预期检索指标数据。

【讨论】:

    猜你喜欢
    • 2021-01-31
    • 2016-09-10
    • 2015-12-13
    • 2017-07-08
    • 2015-10-31
    • 2021-06-05
    • 1970-01-01
    • 2017-01-15
    • 2021-05-08
    相关资源
    最近更新 更多