Skip to content

Latest commit

 

History

History
182 lines (124 loc) · 11.7 KB

storage-files-monitoring.md

File metadata and controls

182 lines (124 loc) · 11.7 KB
title description ms.date ms.custom ms.topic author ms.author ms.service
Monitor Azure Files using Azure Monitor
Learn how to monitor Azure Files and analyze metrics and logs using Azure Monitor.
05/10/2024
horz-monitor
conceptual
khdownie
kendownie
azure-file-storage

Monitor Azure Files

[!INCLUDE horz-monitor-intro]

Applies to

File share type SMB NFS
Standard file shares (GPv2), LRS/ZRS Yes No
Standard file shares (GPv2), GRS/GZRS Yes No
Premium file shares (FileStorage), LRS/ZRS Yes Yes

Important

Metrics and logs in Azure Monitor support only Azure Resource Manager storage accounts. Azure Monitor doesn't support classic storage accounts. If you want to use metrics or logs on a classic storage account, you need to migrate to an Azure Resource Manager storage account. For more information, see Migrate to Azure Resource Manager.

[!INCLUDE horz-monitor-insights]

Azure Storage insights offer a unified view of storage performance, capacity, and availability. See Monitor storage with Azure Monitor Storage insights.

[!INCLUDE horz-monitor-resource-types]

[!INCLUDE horz-monitor-data-storage]

[!INCLUDE horz-monitor-platform-metrics] For a list of available metrics for Azure Files, see Azure Files monitoring data reference.

[!INCLUDE horz-monitor-resource-logs] For the available resource log categories, their associated Log Analytics tables, and the logs schemas for Azure Files, see Azure Files monitoring data reference.

To get the list of SMB and REST operations that are logged, see Storage logged operations and status messages and Azure Files monitoring data reference.

Destination limitations

For general destination limitations, see Destination limitations. The following limitations apply only to monitoring Azure Storage accounts.

  • You can't send logs to the same storage account that you're monitoring with this setting. This situation would lead to recursive logs in which a log entry describes the writing of another log entry. You must create an account or use another existing account to store log information.

  • You can't set a retention policy.

    If you archive logs to a storage account, you can manage the retention policy of a log container by defining a lifecycle management policy. To learn how, see Optimize costs by automatically managing the data lifecycle.

    If you send logs to Log Analytics, you can manage the data retention period of Log Analytics at the workspace level or even specify different retention settings by data type. To learn how, see Change the data retention period.

[!INCLUDE horz-monitor-activity-log]

[!INCLUDE horz-monitor-analyze-data]

[!INCLUDE horz-monitor-external-tools]

Analyze metrics for Azure Files

Metrics for Azure Files are in these namespaces:

  • Microsoft.Storage/storageAccounts
  • Microsoft.Storage/storageAccounts/fileServices

For a list of available metrics for Azure Files, see Azure Files monitoring data reference.

For a list of all Azure Monitor supported metrics, which includes Azure Files, see Azure Monitor supported metrics.

For detailed instructions on how to access and analyze Azure Files metrics such as availability, latency, and utilization, see Analyze Azure Files metrics using Azure Monitor.

Analyze logs for Azure Files

You can access resource logs either as a blob in a storage account, as event data, or through Log Analytics queries. For information about how to send resource logs to different destinations, see Azure resource logs.

To get the list of SMB and REST operations that are logged, see Storage logged operations and status messages and Azure Files monitoring data reference.

Log entries are created only if there are requests made against the service endpoint. For example, if a storage account has activity in its file endpoint but not in its table or queue endpoints, only logs that pertain to the Azure File service are created. Azure Storage logs contain detailed information about successful and failed requests to a storage service. This information can be used to monitor individual requests and to diagnose issues with a storage service. Requests are logged on a best-effort basis.

Log authenticated requests

The following types of authenticated requests are logged:

  • Successful requests
  • Failed requests, including timeout, throttling, network, authorization, and other errors
  • Requests that use Kerberos, NTLM or shared access signature (SAS), including failed and successful requests
  • Requests to analytics data (classic log data in the $logs container and classic metric data in the $metric tables)

Requests made by the Azure Files service itself, such as log creation or deletion, aren't logged.

[!INCLUDE horz-monitor-kusto-queries]

Here are some queries that you can enter in the Log search bar to help you monitor your Azure file shares. These queries work with the new language.

  • View SMB errors over the last week.

    StorageFileLogs
    | where Protocol == "SMB" and TimeGenerated >= ago(7d) and StatusCode contains "-"
    | sort by StatusCode
  • Create a pie chart of SMB operations over the last week.

    StorageFileLogs
    | where Protocol == "SMB" and TimeGenerated >= ago(7d) 
    | summarize count() by OperationName
    | sort by count_ desc
    | render piechart
  • View REST errors over the last week.

    StorageFileLogs
    | where Protocol == "HTTPS" and TimeGenerated >= ago(7d) and StatusText !contains "Success"
    | sort by StatusText asc
  • Create a pie chart of REST operations over the last week.

    StorageFileLogs
    | where Protocol == "HTTPS" and TimeGenerated >= ago(7d) 
    | summarize count() by OperationName
    | sort by count_ desc
    | render piechart

To view the list of column names and descriptions for Azure Files, see StorageFileLogs.

For more information on how to write queries, see Log Analytics tutorial.

[!INCLUDE horz-monitor-alerts]

Azure Files alert rules

The following table lists common and recommended alert rules for Azure Files and the proper metric to use for the alert.

Tip

If you create an alert and it's too noisy, adjust the threshold value and alert logic.

Alert type Condition Description
Metric File share is throttled. Transactions
Dimension name: Response type
Dimension name: FileShare (premium file share only)
Metric File share size is 80% of capacity. File Capacity
Dimension name: FileShare (premium file share only)
Metric File share egress exceeds 500 GiB in one day. Egress
Dimension name: FileShare (premium file share only)
Metric High server latency. Success Server Latency
Dimension name: API Name, for example Read and Write API
Metric File share availability is less than 99.9%. Availability
Dimension name: FileShare (premium file share only)

For instructions on how to create alerts on throttling, capacity, egress, and high server latency, see Create monitoring alerts for Azure Files.

[!INCLUDE horz-monitor-advisor-recommendations]

Related content

Other Azure Files monitoring content:

Overall Azure Storage monitoring content:

Azure Monitor content:

Training modules: