Azure Performance Diagnostics Extension for Better Cloud Services

Author

Reads 394

Computer server in data center room
Credit: pexels.com, Computer server in data center room

The Azure Performance Diagnostics Extension is a game-changer for cloud services. It helps identify and troubleshoot performance issues in Azure applications, making it a must-have for developers and IT professionals.

By using the Azure Performance Diagnostics Extension, you can collect detailed performance data from your Azure applications, including CPU usage, memory usage, and network traffic. This data is then used to identify performance bottlenecks and provide recommendations for improvement.

The extension can also detect issues with Azure services such as Azure Storage and Azure Databases, helping to ensure that your applications are running smoothly and efficiently.

Installation and Removal

Installing the Azure Performance Diagnostics extension is a straightforward process that can be done through the Azure portal.

To install the extension, sign in to the Azure portal, select the virtual machine where you want to install it, and then select the Extensions + applications blade, and select Add.

You'll then search for Azure Performance Diagnostics, click the extension, review the terms and conditions, and select Next.

Credit: youtube.com, How to Enable and configure Azure diagnostics extension for Azure VM (Linux And Windows)

Provide the parameter values for the installation, and then install the extension.

It takes two minutes or less to complete for the basic scenario, but for other scenarios, it runs through the duration specified during the installation.

Alternatively, you can enable this extension for your VM and Virtual Machine Scale Set by using the Azure PowerShell cmdlets, Azure CLI scripts, Azure Resource Manager templates (ARM templates), or the Azure portal.

To remove the extension, sign in to the Azure portal, select the virtual machine from which you want to remove it, and then select the Extensions + applications blade.

Select the Performance Diagnostics Extension, and then select Uninstall.

Note that it's recommended to uninstall the extension through the performance diagnostics blade, as described in Uninstall performance diagnostics.

If you're using ARM templates, be aware that some components of the Linux Diagnostic VM extension are also shipped in the Log Analytics VM extension, and conflicts can arise if both extensions are instantiated in the same template.

To avoid install-time conflicts, use the dependsOn directive to install the extensions sequentially, and install them in either order.

Configuration and Settings

Credit: youtube.com, Optimizing Azure Activity Logs: Extending Diagnostic Settings and Storing Data for Extended Periods

The Azure Performance Diagnostics Extension allows you to configure various settings to control the information collected by the extension.

To update the extension settings, you need to run the same command to deploy the changed settings to the VM. If any settings changed, the updates are sent to the extension, which reloads the configuration and restarts itself.

You can configure public settings to control the information collected by the extension. The public settings structure contains various blocks of settings, and each setting, except ladCfg, is optional.

The public settings include the StorageAccount element, which must be the name specified in the protected settings. The mdsdHttpProxy element is optional and can be specified in the protected settings.

To apply a sample LAD 4.0 configuration, you need to use your own storage account name, account shared access signature token, and Event Hubs SAS tokens. The configuration method differs depending on whether you're using the Azure CLI or Azure PowerShell to install LAD.

Credit: youtube.com, AZ-104 Hands-On Lab 11: Task 5: Configure Azure Virtual Machine Diagnostic Settings

Data is uploaded to the specified storage account and sinks. To verify that the collection is configured, review your configuration to ensure you're only looking for data that you've configured for the collection.

To check the extension configuration, you can use Azure Resource Explorer or remote desktop into the machine and look at the Diagnostics configuration file. The configuration file can be in JSON or XML format, and you may need to decode it to see the XML that was loaded by Diagnostics.

Here's a summary of the public settings structure:

Data and Metrics

Data and metrics are crucial components of Azure Performance Diagnostics Extension. The extension collects metrics from your virtual machines and stores them in Azure Monitor Metrics. You can specify the metrics to collect by providing a resourceId, which is the Azure Resource Manager resource ID of the VM or Virtual Machine Scale Set.

Metrics are aggregated at a specified frequency, with the smallest transfer period being 60 seconds. You can specify multiple scheduledTransferPeriod frequencies, and each aggregation is computed independently. The metrics are then transferred to Azure Monitor Metrics at the specified frequency.

Credit: youtube.com, Azure Monitoring and Alerting Data Source Metrics Audit Logs Tutorial

The extension supports a range of metrics, including processor, memory, network, file system, and disk metrics. The processor class of metrics provides information about processor usage, including counters such as PercentIdleTime, PercentProcessorTime, and PercentIOWaitTime. These counters should sum to 100 percent, and the last three counters (PercentNiceTime, PercentPrivilegedTime, and PercentUserTime) also sum to 100 percent.

If you're having trouble seeing metric data in the Azure portal, check the WADMetrics\* table in the Diagnostics storage account to see if the corresponding metric records are there. Make sure the resource provider Microsoft.Insights is registered, and check the Diagnostics Configuration to ensure the resource ID and performance counters are set correctly. The following counters are enabled by default:

  • \Processor(_Total)% Processor Time
  • \Memory\Available Bytes
  • \ASP.NET Applications(Total)\Requests/Sec
  • \ASP.NET Applications(Total)\Errors Total/Sec
  • \ASP.NET\Requests Queued
  • \ASP.NET\Requests Rejected
  • \Processor(w3wp)% Processor Time
  • \Process(w3wp)\Private Bytes
  • \Process(WaIISHost)% Processor Time
  • \Process(WaIISHost)\Private Bytes
  • \Process(WaWorkerHost)% Processor Time
  • \Process(WaWorkerHost)\Private Bytes
  • \Memory\Page Faults/sec
  • .NET CLR Memory(Global)% Time in GC
  • \LogicalDisk(C:)\Disk Write Bytes/sec
  • \LogicalDisk(C:)\Disk Read Bytes/sec
  • \LogicalDisk(D:)\Disk Write Bytes/sec
  • \LogicalDisk(D:)\Disk Read Bytes/sec

Missing Metric Data in Portal

If metric data doesn't appear in the Azure portal, it's likely because the WADMetrics* table in the Diagnostics storage account is empty or the resource provider Microsoft.Insights is not registered.

Check the WADMetrics* table to see if the corresponding metric records are there, and ensure that the resource provider Microsoft.Insights is registered.

Credit: youtube.com, Azure SQL Database Availability metric | Data Exposed

The PartitionKey of the table is the resource ID, virtual machine, or virtual machine scale set, while the RowKey is the metric name, also known as the performance counter name.

If the resource ID is incorrect, check Diagnostics Configuration > Metrics > ResourceId to see if the resource ID is set correctly.

Here are some common performance counters that are enabled by default:

  • \Processor(_Total)% Processor Time
  • \Memory\Available Bytes
  • \ASP.NET Applications(Total)\Requests/Sec
  • \ASP.NET Applications(Total)\Errors Total/Sec
  • \ASP.NET\Requests Queued
  • \ASP.NET\Requests Rejected
  • \Processor(w3wp)% Processor Time
  • \Process(w3wp)\Private Bytes
  • \Process(WaIISHost)% Processor Time
  • \Process(WaIISHost)\Private Bytes
  • \Process(WaWorkerHost)% Processor Time
  • \Process(WaWorkerHost)\Private Bytes
  • \Memory\Page Faults/sec
  • .NET CLR Memory(Global)% Time in GC
  • \LogicalDisk(C:)\Disk Write Bytes/sec
  • \LogicalDisk(C:)\Disk Read Bytes/sec
  • \LogicalDisk(D:)\Disk Write Bytes/sec
  • \LogicalDisk(D:)\Disk Read Bytes/sec

Data Captured

Data captured by PerfInsights is dependent on the selected scenario, so be sure to check the documentation for more information.

PerfInsights collects various logs, configuration, and diagnostic data, which can be quite detailed.

If you've verified that data is getting captured locally but still don't see it in your storage account, there are several steps you can take to troubleshoot the issue.

Here are some specific things to check: Verify that you've provided a correct storage account and that you haven't rolled over keys for the given storage account.Make sure the storage account is correct and that there are no network restrictions preventing the components from reaching public storage endpoints.Check the monitoring agent's logs for any errors that might indicate failures reading to local files or writing to storage.

Event logs, performance counters, and trace logs are all types of data that can be used to determine if the host is generating data.

To check performance counters, open perfmon and check the counter.

Metrics

Credit: youtube.com, What Are Metrics & Dimensions? | BI For Beginners

Metrics are a crucial part of data collection, and understanding how they work is essential for making informed decisions.

Metrics can be specified in the performanceCounters section, where samples of the metrics are collected every 15 seconds or at the sample rate explicitly defined for the counter.

The default metrics that LAD supports are aggregated across all file systems, disks, or names, and the display names for each metric differ depending on the metrics namespace to which it belongs.

The builtin metric provider is a source of metrics that are the most interesting to a broad set of users, and these metrics fall into five broad classes: Processor, Memory, Network, File system, and Disk.

The Processor class of metrics provides information about processor usage in the VM, and when percentages are aggregated, the result is the average across all CPUs.

The following counters are enabled by default: \Processor(_Total)% Processor Time, \Memory\Available Bytes, \ASP.NET Applications(Total)\Requests/Sec, and many others.

Credit: youtube.com, Data Governance Success Metrics

If you're having trouble seeing metric data in the Azure portal, check the WADMetrics\* table in the Diagnostics storage account to see if the corresponding metric records are there.

Performance counters data is available in storage but doesn't show in the portal if the counter names aren't in English or if you're using wildcards (*) in your performance counter names.

To troubleshoot issues with metrics, you can check the following:

  • Whether the data in storage has counter names in English.
  • If you're using wildcards (*) in your performance counter names.

If you're still having trouble, try checking the following:Performance counters: Open perfmon and check the counter.Trace logs: Remote access into the VM and add a TextWriterTraceListener to the app's config file.Event Tracing for Windows (ETW) traces: Remote access into the VM and install the PerfView tool.Event logs: Remote access into the VM. Open Event Viewer and make sure that the events exist.

Azure and Infrastructure

To troubleshoot issues with the Azure Performance Diagnostics Extension, you'll want to start by checking your diagnostics logs. Make sure you've enabled the capture of Diagnostics infrastructure logs in your configuration, as this will allow you to quickly look for any relevant errors.

Credit: youtube.com, Azure Master Class v2 - Module 10 - Monitoring & Security

The Diagnostics infrastructure logs table in your configured storage account is named DiagnosticInfrastructureLogsTable. This is where you'll find ETW events, which are named using a specific code.

To resolve common issues, try uninstalling and reinstalling the agent. This simple step can often resolve problems with the extension. Here's a step-by-step guide to doing so:

  1. Uninstall the agent.
  2. Remove the directory C:\WindowsAzure\Logs\Plugins\Microsoft.Azure.Diagnostics.IaaSDiagnostics.
  3. Install the agent again.

.NET 4.5 Dependency

The .NET 4.5 dependency is a common issue when working with Azure Diagnostics extension for Windows. It requires .NET Framework 4.5 or later to run.

You might encounter this issue if you create a machine from an old image or snapshot, or if you bring your own custom disk. This can lead to an unhandled exception.

The issue typically manifests as an exit code 255 when you run DiagnosticsPluginLauncher.exe. This happens because the required .NET 4.5 or later is not installed.

To resolve this issue, you need to install .NET 4.5 or later on your machine. This will ensure that the Azure Diagnostics extension for Windows runs smoothly.

Lamar Smitham

Writer

Lamar Smitham is a seasoned writer with a passion for crafting informative and engaging content. With a keen eye for detail and a knack for simplifying complex topics, Lamar has established himself as a trusted voice in the industry. Lamar's areas of expertise include Microsoft Licensing, where he has written in-depth articles that provide valuable insights for businesses and individuals alike.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.