Thursday, 6 September 2012

Azure Storage Analytics In Readable Format


 Azure storage analytics in readable format
 

Why should you use storage analytics?


Windows Azure Storage Analytics feature helps users to identify usage patterns for all services available within an Azure storage account. This feature provides a trace of the executed requests against your storage account (Blobs, Tables and Queues). 
 
Azure storage analytics allows you to:  

·         monitor requests to your storage accounts
·         understand performance of individual requests
·         analyze usage of specific containers and blobs
·         debug storage APIs at a request level.  

Storage Analytics Log Format 


Each version 1.0 log entry adheres to the following format: 

<version-number>;<request-start-time>;<operation-type>;<request-status>;<http-status-code>;<end-to-end-latency-in-ms>;<server-latency-in-ms>;<authentication-type>;<requester-account-name>;<owner-account-name>;<service-type>;<request-url>;<requested-object-key>;<request-id-header>;<operation-count>;<requester-ip-address>;<request-version-header>;<request-header-size>;<request-packet-size>;<response-header-size>;<response-packet-size>;<response-content-length>;<request-md5>;<server-md5>;<etag-identifier>;<last-modified-time>;<conditions-used>;<user-agent-header>;<referrer-header>;<client-request-id> 

Sample Log 



As you can see logs presented in this manner are not in a human readable format. To find out which entry represents the request packet size, you have to count the fields from the first entry and then get to the required field. This is no easy task.
 
I have now come across some tools that will simplify things and present the logs in a readable format.

Tools

Let us now look at some of these tools:
·         Azure Storage Explorer 5 Preview 1 - This tool helps to view the logs created after enabling storage analytics against a storage account. The logs seen with help of this tool are in same format as described above.
  • CloudBerry Explorer for Azure blob storage - This tool provides support for viewing Windows Azure Storage Analytics log in readable format.  I have added here sample log information retrieved with the help of this tool.
     
                         Figure 1 Sample log information from CloudBerry Explorer
     
      Is it not now easy to read the log in the screen shot than in the sample log?  

    ·         Azure-Storage-Analytics Viewer – This is a visual tool that you can use to download Azure Storage Metrics and Log data, and display them the form of a chart.  You can download this tool from the github website: https://github.com/mogliang/Azure-Storage-Analytics-Viewer

                                Figure 2 Azure-Storage-Analytics Viewer 
 
To use this tool, enter the storage account information in the Azure-Storage-Analytics Viewer window and click the Load Metrics button. 
You can see the various metrics represented in the form of a chart.  To add metrics to the chart, right-click on a chart and select any option from the pop-up menu.
 
 
                                     Figure 3 Metrices Information Available in Chart Form 

You can select the period for which you wish to analyze the log information and save it to a  csv file. Following is a sample snapshot of the csv file which contains storage analytics information for the period between 9 AM on 05th September 2012 and 9 AM on 6th September 2012.

 
                                     Figure 4 Sample CSV Log Snapshot from Azure-Storage-Analytics Viewer

This is the best way to analyse the usage patterns for a storage account and make decisions for effective utilization of storage account.
References