簡體   English   中英

Azure存儲帳戶指標僅對經典存儲帳戶可見

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

我已經測試了在新的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門戶中的Classic Storage帳戶。 對於“新”存儲帳戶,它僅顯示“無可用數據”。

這是一個錯誤嗎? 或者是一個經典的存儲帳戶默認配置了一些屬性我手動需要應用於新的存儲帳戶,使其行為相似?

Microsoft Azure Storage Explorer的屏幕截圖

根據您的代碼設置,我利用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);

在代碼段中,您可以配置Blob存儲的分鍾/小時指標。

由於您已確認相關表包含度量標准記錄,因此您可以嘗試登錄Azure門戶,選擇存儲帳戶,單擊“隊列服務”>“度量標准”,單擊“編輯圖表”並更改“時間范圍”,如下所示:

注意:如果存在任何度量標准記錄,則默認情況下將時間范圍設置為今天。 可能存在數據延遲,您可以嘗試指定時間范圍,並確定是否可以按預期檢索指標數據。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM