<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Elastic Observability Labs - Articles by Hemant Malik</title>
        <link>https://www.elastic.co/observability-labs</link>
        <description>Trusted security news &amp; research from the team at Elastic.</description>
        <lastBuildDate>Fri, 07 Aug 2026 12:17:27 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>Elastic Observability Labs - Articles by Hemant Malik</title>
            <url>https://www.elastic.co/observability-labs/assets/observability-labs-thumbnail.png</url>
            <link>https://www.elastic.co/observability-labs</link>
        </image>
        <copyright>© 2026. Elasticsearch B.V. All Rights Reserved</copyright>
        <item>
            <title><![CDATA[Bringing observability insights from Elastic AI Assistant to the world of GitHub Copilot]]></title>
            <link>https://www.elastic.co/observability-labs/blog/ai-assistant-to-github-copilot</link>
            <guid isPermaLink="false">ai-assistant-to-github-copilot</guid>
            <pubDate>Thu, 23 May 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[GitHub announced GitHub Copilot Extensions this week at Microsoft Build. We are working with the GitHub team to bring observability insights from Elastic AI Assistant to GitHub Copilot users.]]></description>
            <content:encoded><![CDATA[<p>GitHub <a href="https://github.blog/2024-05-21-introducing-github-copilot-extensions/">announced</a> GitHub Copilot Extensions this week at Microsoft Build. We are working with the GitHub team in the Limited Beta Program to explore bringing observability insights from Elastic AI Assistant to GitHub Copilot users.</p>
<p>Elastic’s GitHub Copilot Extension aims to combine the capabilities of GitHub Copilot and Elastic AI Assistant for Observability. This could enable developers to access critical insights from Elastic AI Assistant from GitHub Copilot Chat on GitHub.com, Visual Studio, GitHub.com, Visual Studio, and VS Code - places where they write their code.</p>
<p>Developers will be able ask questions such as</p>
<ul>
<li>What errors are active?</li>
<li>What’s the latest stacktrace for my application?</li>
<li>What caused a slowdown in the application after the last push to the dev environment?</li>
<li>How to write an ES|QL for query that my app will send to Elasticsearch?</li>
<li>What runbook from Github has been loaded into Elasticsearch and is related to the issue I’m investigating
And many more!</li>
</ul>
<p><a href="https://build.microsoft.com/en-US/sessions/acc48a7a-b412-4b4f-88a6-53ef4b2cb2bc?source=/schedule">Watch Jeff's PoC Demo@Microsoft Build 2024</a></p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/ai-assistant-to-github-copilot/elastic-copilot-vscode.png" alt="Elastic's Copilot Extension in VSCode" /></p>
<p><em>Elastic AI Assistant surfaced in GitHub Copilot Chat from our Extension (Proof of Concept)</em></p>
<h2>What is the Elastic AI Assistant for Observability</h2>
<p>The Elastic Observability AI Assistant for Observability, a user-centric tool, is a game-changer in providing contextual insights and streamlining troubleshooting within the Elastic Observability environment. By harnessing generative AI capabilities, the assistant offers open prompts that decipher error messages and propose remediation actions. It adopts a Retrieval-Augmented Generation (RAG) approach to fetch the most pertinent internal information, such as APM traces, log messages, SLOs, GitHub issues, runbooks, and more. This contextual assistance is a huge leap forward for Site Reliability Engineers (SREs) and operations teams, offering immediate, relevant solutions to issues based on existing documentation and resources, boosting developer productivity.</p>
<p>For more information on setting up and using the AI Assistant for Observability check out the blog <a href="https://www.elastic.co/observability-labs/blog/elastic-ai-assistant-observability-microsoft-azure-openai">Getting started with the Elastic AI Assistant for Observability and Microsoft Azure OpenAI</a>. Additionally, learn how <a href="https://www.elastic.co/observability-labs/blog/elastic-rag-ai-assistant-application-issues-llm-github">Elastic Observability AI Assistant uses RAG to help analyze application issues with GitHub issues</a>.</p>
<p>One unique feature of the AI Assistant is its API support. This allows you to take advantage of all the capabilities provided by the Elastic AI Assistant, and integrate them right into your workflow.</p>
<h2>What is a GitHub Copilot Extension</h2>
<p>GitHub Copilot Extensions, a new addition to GitHub Copilot, revolutionizes the developer experience by integrating a diverse array of tools and services directly into the developer's workflow. These unique extensions, crafted by partners, enable developers to interact with various services and tools using natural language within their Integrated Development Environment (IDE) or GitHub.com. This integration eliminates the need for context-switching, allowing developers to maintain their flow state, troubleshoot issues, and deploy solutions with unparalleled efficiency. These extensions will be accessible through GitHub Copilot Chat in the GitHub Marketplace, with options for organizations to create private extensions tailored to their internal tooling.</p>
<h2>What’s next</h2>
<p>We are participating in the Github Limited Beta Program as a partner and exploring the possibility of bringing Elastic GitHub Copilot Extension to the GitHub Marketplace. We are excited to unlock insights from Elastic Observability to GitHub Copilot users side by side to the code behind those services. Stay tuned!</p>
<p>Resources:</p>
<ul>
<li><a href="https://www.elastic.co/observability-labs/blog/elastic-ai-assistant-observability-microsoft-azure-openai">Getting Started with Elastic AI Assistant for Observability with Azure OpenAI</a></li>
<li><a href="https://ela.st/assistant-escapes">The Elastic AI Assistant for Observability escapes Kibana!</a></li>
<li><a href="https://www.elastic.co/observability-labs/blog/elastic-rag-ai-assistant-application-issues-llm-github">Elastic Observability AI Assistant uses RAG to help analyze application issues with GitHub issues</a></li>
<li><a href="https://www.elastic.co/observability-labs/blog/sre-troubleshooting-ai-assistant-observability-runbooks">Troubleshooting with Elastic AI Assistant using your organization's runbooks</a></li>
<li><a href="https://www.elastic.co/guide/en/observability/current/obs-ai-assistant.html">The AI Assistant Observability documentation</a></li>
<li><a href="https://github.blog/2024-05-21-introducing-github-copilot-extensions/">GitHub Copilot Extensions Blog Announcement</a></li>
<li><a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/esql.html">ES|QL documentation</a></li>
</ul>
]]></content:encoded>
            <category>observability-labs</category>
            <enclosure url="https://www.elastic.co/observability-labs/assets/images/ai-assistant-to-github-copilot/githubcopilot-aiassistant-C-2x.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Elastic Observability monitors metrics for Microsoft Azure in just minutes]]></title>
            <link>https://www.elastic.co/observability-labs/blog/observability-monitors-metrics-microsoft-azure</link>
            <guid isPermaLink="false">observability-monitors-metrics-microsoft-azure</guid>
            <pubDate>Mon, 29 Jan 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[Follow this step-by-step process to enable Elastic Observability for Microsoft Azure metrics.]]></description>
            <content:encoded><![CDATA[<p>Developers and SREs choose Microsoft Azure to run their applications because it is a trustworthy world-class cloud platform. It has also proven itself over the years as an extremely powerful and reliable infrastructure for hosting business-critical applications.</p>
<p>Elastic Observability offers over 25 out-of-the-box integrations for Microsoft Azure services with more on the way. A full list of Azure integrations can be found in <a href="https://docs.elastic.co/integrations/azure">our online documentation</a>.</p>
<p>Elastic Observability aggregates not only logs but also metrics for Azure services and the applications running on Azure compute services (Virtual Machines, Functions, Kubernetes Service, etc.). All this data can be analyzed visually and more intuitively using Elastic®’s advanced machine learning (ML) capabilities, which help detect performance issues and surface root causes before end users are affected.</p>
<p>For more details on how Elastic Observability provides application performance monitoring (APM) capabilities such as service maps, tracing, dependencies, and ML-based metrics correlations, read <a href="https://www.elastic.co/blog/apm-correlations-elastic-observability-root-cause-transactions">APM correlations in Elastic Observability: Automatically identifying probable causes of slow or failed transactions</a>.</p>
<p>That’s right, Elastic offers capabilities to collect, aggregate, and analyze metrics for Microsoft Azure services and applications running on Azure. Elastic Observability is for more than just capturing logs — it offers a unified observability solution for Microsoft Azure workloads.</p>
<p>In this blog, we’ll review how Elastic Observability can monitor metrics for a three-tier web application running on Microsoft Azure and leveraging:</p>
<ul>
<li>Microsoft Azure Virtual Machines</li>
<li>Microsoft Azure SQL database</li>
<li>Microsoft Azure Virtual Network</li>
</ul>
<p>As you will see, once the integration is installed, metrics will arrive instantly and you can immediately start deriving insights from metrics.</p>
<h2>Prerequisites and config</h2>
<p>Here are some of the components and details we used to set up this demonstration:</p>
<ul>
<li>Ensure you have a Microsoft Azure account and an Azure service principal with permission to read monitoring data from Microsoft Azure (<a href="https://docs.elastic.co/integrations/azure_metrics/monitor#integration-specific-configuration-notes">see details in our documentation</a>).</li>
<li>This post does <em>not</em> cover application monitoring; instead, we will focus on how Microsoft Azure services can be easily monitored. If you want to get started with examples of application monitoring, see our <a href="https://github.com/elastic/observability-examples/tree/main/azure/container-apps">Hello World observability code samples</a>.</li>
<li>In order to see metrics, you will need to load the application. We’ve also created a Playwright script to drive traffic to the application.</li>
</ul>
<h2>Three-tier application overview</h2>
<p>Before we dive into the Elastic deployment setup and configuration, let's review what we are monitoring. If you follow the <a href="https://learn.microsoft.com/en-us/training/modules/n-tier-architecture/">Microsoft Learn N-tier example app</a> instructions for deploying the &quot;What's for Lunch?&quot; app, you will have the following deployed.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-three-tier-application-overview.png" alt="three tier application overview" /></p>
<p>What’s deployed:</p>
<ul>
<li>Microsoft Azure VM presentation tier that renders an HTML client in the user's browser and enables user requests to be sent to the “What’s for Lunch?” app</li>
<li>Microsoft Azure VM application tier that communicates with the presentation and the database tier</li>
<li>Microsoft Azure SQL instance in the database tier, handling requests from the application tier to store and serve data</li>
</ul>
<p>At the end of the blog, we will also provide a Playwright script that can be run to send requests to this app in order to load it with example data and exercise its functionality. This will help drive metrics to “light up” the dashboards.</p>
<h2>Setting it all up</h2>
<p>Let’s walk through the details of how to deploy the example three-tier application, Azure integration on Elastic and visualize what gets ingested in Elastic’s Kibana® dashboards.</p>
<h3>Step 0: Get an account on Elastic Cloud</h3>
<p>Follow the instructions to <a href="https://cloud.elastic.co/registration">get started on Elastic Cloud</a>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-free-trial.png" alt="elastic cloud free trial sign up" /></p>
<h3>Step 1: Deploy the Microsoft Azure three-tier application</h3>
<p>From the <a href="https://portal.azure.com/">Azure portal</a>, click the Cloud Shell icon at the top of the portal to open Cloud Shell…</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-open-cloud-shell.png" alt="open cloud shell" /></p>
<p>… and when the Cloud Shell first opens, select <strong>Bash</strong> as the shell type to use.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-cloud-shell-bash.png" alt="cloud shell bash" /></p>
<p>If you’re prompted that “You have no storage mounted,” then click the <strong>Create storage</strong> button to create a file store to be used for saving and editing files from Cloud Shell.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-create-storage.png" alt="cloud shell create storage" /></p>
<p>You should now see the open Cloud Shell terminal.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-cloud-shell-terminal.png" alt="cloud shell terminal" /></p>
<p>Run the following command in Cloud Shell to define the environment variables that we’ll be using in the Cloud Shell commands required to deploy and view the sample application.</p>
<p>Be sure to specify a valid RESOURCE_GROUP from your available <a href="https://portal.azure.com/#view/HubsExtension/BrowseResourceGroups">Resource Groups listed in the Azure portal</a>. Also specify a new password to replace the SpecifyNewPasswordHere placeholder text before running the command. See the Microsoft <a href="https://learn.microsoft.com/en-us/sql/relational-databases/security/password-policy?view=sql-server-ver16#password-complexity">password policy documentation</a> for password requirements.</p>
<pre><code class="language-bash">RESOURCE_GROUP=&quot;test&quot;
APP_PASSWORD=&quot;SpecifyNewPasswordHere&quot;
</code></pre>
<p>Run the following az deployment group create command, which will deploy the example three-tier web app in around five minutes.</p>
<pre><code class="language-bash">az deployment group create --resource-group $RESOURCE_GROUP --template-uri https://raw.githubusercontent.com/MicrosoftDocs/mslearn-n-tier-architecture/master/Deployment/azuredeploy.json --parameters password=$APP_PASSWORD
</code></pre>
<p>After the deployment has completed, run the following command, which returns the URL for the app.</p>
<pre><code class="language-bash">az deployment group show --output table --resource-group $RESOURCE_GROUP --name azuredeploy --query properties.outputs.webSiteUrl
</code></pre>
<p>Copy the web app URL and paste it into a browser to view the example “What’s for Lunch?” web app.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-whats-for-lunch.png" alt="whats for lunch app" /></p>
<h3>Step 2: Create an Azure service principal and grant access permission</h3>
<p>Go to the <a href="https://portal.azure.com/">Microsoft Azure Portal</a>. Search for active directory and select <strong>Microsoft Entra ID</strong>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-active-directory.png" alt="search active directory" /></p>
<p>Copy the <strong>Tenant ID</strong> for use in a later step in this blog post. This ID is required to configure Elastic Agent to connect to your Azure account.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-your-organization-overview.png" alt="your organization overview" /></p>
<p>In the navigation pane, select <strong>App registrations</strong>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-your-organization-overview-app-registrations.png" alt="your organization overview app registrations" /></p>
<p>Then click <strong>New registration</strong>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-your-organization-new-registration.png" alt="your organization new registrations" /></p>
<p>Type the name of your application (this tutorial uses three-tier-app-azure) and click <strong>Register</strong> (accept the default values for other settings).</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-register_an_application.png" alt="register an application" /></p>
<p>Copy the <strong>Application (client) ID</strong> and save it for later. This ID is required to configure Elastic Agent to connect to your Azure account.</p>
<p>In the navigation pane, select <strong>Certificates &amp; secrets</strong> , and then click <strong>New client secret</strong> to create a new security key.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-three-tier-app-new-client-secret.png" alt="three tier app new client secret" /></p>
<p>Type a description of the secret and select an expiration. Click <strong>Add</strong> to create the client secret. Under <strong>Value</strong> , copy the secret value and save it (along with your client ID) for later.</p>
<p>After creating the Azure service principal, you need to grant it the correct permissions. In the Azure Portal, search for and select <strong>Subscriptions</strong>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-three-tier-subscriptions.png" alt="three tier subscriptions" /></p>
<p>In the Subscriptions page, click the name of your subscription. On the subscription details page, copy your <strong>Subscription ID</strong> and save it for a later step.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-subscription-essentials-copy.png" alt="subscription essentials copy" /></p>
<p>In the navigation pane, select <strong>Access control (IAM)</strong>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-subscription-access-control.png" alt="subscription access control" /></p>
<p>Click <strong>Add</strong> and select <strong>Add role assignment</strong>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-subscription-access-control-add-role-assignment.png" alt="subscription access control add role assignment" /></p>
<p>On the <strong>Role</strong> tab, select the <strong>Monitoring Reader</strong> role and then click <strong>Next</strong>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-add-role-assignment-monitoring-readers.png" alt="add role assignment monitoring reader" /></p>
<p>On the <strong>Members</strong> tab, select the option to assign access to <strong>User, group, or service principal</strong>. Click <strong>Select members</strong> , and then search for and select the principal you created earlier. For the description, enter the name of your service principal. Click <strong>Next</strong> to review the role assignment.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-add-role-assignment-description.png" alt="add role assignment description" /></p>
<p>Click <strong>Review + assign</strong> to grant the service principal access to your subscription.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-add-role-assignment-review-assign.png" alt="add role assignment review assign" /></p>
<h3>Step 3: Create an Azure VM instance</h3>
<p>In the Azure Portal, search for and select <strong>Virtual machines</strong>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-search-virtual-machines.png" alt="search virtual machines" /></p>
<p>On the <strong>Virtual machines</strong> page, click <strong>+ Create</strong> and select <strong>Azure virtual machine</strong>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-azure-virtual-machine.png" alt="azure virtual machine" /></p>
<p>On the Virtual machine creation page, enter a name like “metrics-vm” for the virtual machine name and select VM Size to be “Standard_D2s_v3 - 2 vcpus, 8 GiB memory.” Click the <strong>Next : Disks</strong> button.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-create-virtual-macine-next-disks.png" alt="create a virtual machine next disks" /></p>
<p>On the <strong>Disks</strong> page, keep the default settings and click the <strong>Next : Networking</strong> button.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-create-virtual-machine-next-networking.png" alt="create a virtual machine next networking" /></p>
<p>On the <strong>Networking</strong> page, demo-vnet should be selected for <strong>Virtual network</strong> and demo-biz-subnet should be selected for <strong>Subnet</strong>. These resources are created as part of the three-tier example app’s deployment that was done in Step 1.</p>
<p>Click the <strong>Review + create</strong> button.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-create-virtual-machine-review-create.png" alt="create virtual machine review create" /></p>
<p>On the <strong>Review</strong> page, click the <strong>Create</strong> button.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-create-virtual-machine-validation-passed.png" alt="create virtual machine validation passed" /></p>
<h3>Step 4: Install the Azure Resource Metrics integration</h3>
<p>In your <a href="https://cloud.elastic.co/home">Elastic Cloud</a> deployment, navigate to the Elastic Azure integrations by selecting <strong>Integrations</strong> from the top-level menu. Search for azure resource and click the <strong>Azure Resource Metrics</strong> tile.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-integrations-azure-resource-metrics.png" alt="integrations azure resource metrics" /></p>
<p>Click <strong>Add Azure Resource Metrics.</strong></p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-azure-resource-metrics.png" alt="azure resource metrics" /></p>
<p>Click <strong>Add integration only (skip agent installation)</strong>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-add-integration-only.png" alt="add integration only" /></p>
<p>Enter the values that you saved previously for Client ID, Client Secret, Tenant ID, and Subscription ID.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-add-azure-resource-metrics-integration.png" alt="add azure resource metrics integration" /></p>
<p>As you can see, the Azure Resource Metrics integration will collect a significant amount of data from eight Azure services. Click <strong>Save and continue</strong>.</p>
<p>You’ll be presented with a confirmation dialog window. Click <strong>Add Elastic Agent to your hosts</strong>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-azure-resource-metrics-integration-added.png" alt="azure resource metrics integration added" /></p>
<p>This will display the instructions required to install the Elastic agent. Copy the command under the <strong>Linux Tar</strong> tab.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-add-agent.png" alt="add agent linux tar" /></p>
<p>Next you will need to use SSH to log in to the Azure VM instance and run the commands copied from <strong>Linux Tar</strong> tab. Go to <a href="https://portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Compute/VirtualMachines">Azure Virtual Machines</a> in the Azure portal. Then click the name of the VM instance that you created in Step 3.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-metrics-vm.png" alt="metrics vm" /></p>
<p>Click the <strong>Select</strong> button in the <strong>SSH Using Azure CLI</strong> section.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-metrics-vm-connect.png" alt="metrics vm connect" /></p>
<p>Select the “I understand …” checkbox and then click the <strong>Configure + connect</strong> button.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-ssh-using-azure-cli.png" alt="ssh using azure cli" /></p>
<p>Once you are SSH’d inside the VM instance terminal window, run the commands copied previously from <strong>Linux Tar tab</strong> in the <strong>Install Elastic Agent on your host</strong> instructions. When the installation completes, you’ll see a confirmation message in the Install Elastic Agent on your host form.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-add-agent-confirmed.png" alt="add agent confirmed" /></p>
<p>Super! The Elastic agent is sending data to Elastic Cloud. Now let’s observe some metrics.</p>
<h3>Step 5: Run traffic against the application</h3>
<p>While getting the application running is fairly easy, there is nothing to monitor or observe with Elastic unless you add a load on the application.</p>
<p>Here is a simple script you can also run using <a href="https://playwright.dev/">Playwright</a> to add traffic and exercise the functionality of the Azure three-tier application:</p>
<pre><code class="language-javascript">import { test, expect } from &quot;@playwright/test&quot;;

test(&quot;homepage for Microsoft Azure three tier app&quot;, async ({ page }) =&gt; {
  // Load web app
  await page.goto(&quot;http://20.172.198.231/&quot;);
  // Add lunch suggestions
  await page.fill(&quot;id=txtAdd&quot;, &quot;tacos&quot;);
  await page.keyboard.press(&quot;Enter&quot;);
  await page.waitForTimeout(1000);
  await page.fill(&quot;id=txtAdd&quot;, &quot;sushi&quot;);
  await page.keyboard.press(&quot;Enter&quot;);
  await page.waitForTimeout(1000);
  await page.fill(&quot;id=txtAdd&quot;, &quot;pizza&quot;);
  await page.keyboard.press(&quot;Enter&quot;);
  await page.waitForTimeout(1000);
  await page.fill(&quot;id=txtAdd&quot;, &quot;burgers&quot;);
  await page.keyboard.press(&quot;Enter&quot;);
  await page.waitForTimeout(1000);
  await page.fill(&quot;id=txtAdd&quot;, &quot;salad&quot;);
  await page.keyboard.press(&quot;Enter&quot;);
  await page.waitForTimeout(1000);
  await page.fill(&quot;id=txtAdd&quot;, &quot;sandwiches&quot;);
  await page.keyboard.press(&quot;Enter&quot;);
  await page.waitForTimeout(1000);
  // Click vote buttons
  await page.getByRole(&quot;button&quot;).nth(1).click();
  await page.getByRole(&quot;button&quot;).nth(3).click();
  await page.getByRole(&quot;button&quot;).nth(5).click();
  await page.getByRole(&quot;button&quot;).nth(7).click();
  await page.getByRole(&quot;button&quot;).nth(9).click();
  await page.getByRole(&quot;button&quot;).nth(11).click();
  // Click remove buttons
  await page.getByRole(&quot;button&quot;).nth(12).click();
  await page.getByRole(&quot;button&quot;).nth(10).click();
  await page.getByRole(&quot;button&quot;).nth(8).click();
  await page.getByRole(&quot;button&quot;).nth(6).click();
  await page.getByRole(&quot;button&quot;).nth(4).click();
  await page.getByRole(&quot;button&quot;).nth(2).click();
});
</code></pre>
<h3>Step 6: View Azure dashboards in Elastic</h3>
<p>With Elastic Agent running, you can go to Elastic Dashboards to view what’s being ingested. Simply search for “dashboard” in Elastic and choose <strong>Dashboard</strong>.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-dashboard.png" alt="dashboard" /></p>
<p>This will open the Elastic Dashboards page. In the Dashboards search box, search for azure vm and click the <strong>[Azure Metrics] Compute VMs Overview</strong> dashboard, one of the many out-of-the-box dashboards available.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-dashboards-create.png" alt="dashboards create" /></p>
<p>You will see a Dashboard populated with your deployed application’s VM metrics.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/blog-elastic-azure-compute-vm.png" alt="azure compute vm" /></p>
<p>On the Azure Compute VM dashboard, we can see the following sampling of some of the many available metrics:</p>
<ul>
<li>CPU utilization</li>
<li>Available memory</li>
<li>Network sent and received bytes</li>
<li>Disk writes and reads metrics</li>
</ul>
<p>For metrics not covered by out-of-the-box dashboards, custom dashboards can be easily created to visualize metrics that are important to you.</p>
<p><strong>Congratulations, you have now started monitoring metrics from Microsoft Azure services for your application!</strong></p>
<h2>Analyze your data with Elastic AI Assistant</h2>
<p>Once metrics and logs (or either one) are in Elastic, start analyzing your data with <a href="https://www.elastic.co/blog/context-aware-insights-elastic-ai-assistant-observability">context-aware insights using the Elastic AI Assistant for Observability</a>.</p>
<h2>Conclusion: Monitoring Microsoft Azure service metrics with Elastic Observability is easy!</h2>
<p>We hope you’ve gotten an appreciation for how Elastic Observability can help you monitor Azure service metrics. Here’s a quick recap of what you learned:</p>
<ul>
<li>Elastic Observability supports ingest and analysis of Azure service metrics.</li>
<li>It’s easy to set up ingest from Azure services via the Elastic Agent.</li>
<li>Elastic Observability has multiple out-of-the-box Azure service dashboards you can use to preliminarily review information and then modify for your needs.</li>
</ul>
<p>Try it out for yourself by signing up via <a href="https://portal.azure.com/#view/Microsoft_Azure_Marketplace/GalleryItemDetailsBladeNopdl/id/elastic.ec-azure-pp">Microsoft Azure Marketplace</a> and quickly spin up a deployment in minutes on any of the <a href="https://www.elastic.co/guide/en/cloud/current/ec-reference-regions.html#ec_azure_regions">Elastic Cloud regions on Microsoft Azure</a> around the world. Your Azure Marketplace purchase of Elastic will be included in your monthly consolidated billing statement and will draw against your committed spend with Microsoft Azure.</p>
<p><em>The release and timing of any features or functionality described in this post remain at Elastic's sole discretion. Any features or functionality not currently available may not be delivered on time or at all.</em></p>
]]></content:encoded>
            <category>observability-labs</category>
            <enclosure url="https://www.elastic.co/observability-labs/assets/images/observability-monitors-metrics-microsoft-azure/Azure_Dark_(1).png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Trace your Azure Function application with Elastic Observability]]></title>
            <link>https://www.elastic.co/observability-labs/blog/trace-azure-function-application-observability</link>
            <guid isPermaLink="false">trace-azure-function-application-observability</guid>
            <pubDate>Tue, 16 May 2023 00:00:00 GMT</pubDate>
            <description><![CDATA[Serverless applications deployed on Azure Functions are growing in usage. This blog shows how to deploy a serverless application on Azure functions with Elastic Agent and use Elastic's APM capability to manage and troubleshoot issues.]]></description>
            <content:encoded><![CDATA[<p>Adoption of Azure Functions in cloud-native applications on Microsoft Azure has been increasing exponentially over the last few years. Serverless functions, such as the Azure Functions, provide a high level of abstraction from the underlying infrastructure and orchestration, given these tasks are managed by the cloud provider. Software development teams can then focus on the implementation of business and application logic. Some additional benefits include billing for serverless functions based on the actual compute and memory resources consumed, along with automatic on-demand scaling.</p>
<p>While the benefits of using serverless functions are manifold, it is also necessary to make them observable in the wider end-to-end microservices architecture context.</p>
<h2>Elastic Observability (APM) for Azure Functions: The architecture</h2>
<p><a href="https://www.elastic.co/blog/whats-new-elastic-observability-8-7-0">Elastic Observability 8.7</a> introduced distributed tracing for Microsoft Azure Functions — available for the Elastic APM Agents for .NET, Node.js, and Python. Auto-instrumentation of HTTP requests is supported out-of-the-box, enabling the detection of performance bottlenecks and sources of errors.</p>
<p>The key components of the solution for observing Azure Functions are:</p>
<ol>
<li>The Elastic APM Agent for the relevant language</li>
<li>Elastic Observability</li>
</ol>
<p><img src="https://www.elastic.co/observability-labs/assets/images/trace-azure-function-application-observability/blog-elastic-azure-function.png" alt="azure function" /></p>
<p>The APM server validates and processes incoming events from individual APM Agents and transforms them into Elasticsearch documents. The APM Agent provides auto-instrumentation capabilities for the application being observed. The Node.js APM Agent can trace function invocations in an Azure Functions app.</p>
<h2>Setting up Elastic APM for Azure Functions</h2>
<p>To demonstrate the setup and usage of Elastic APM, we will use a <a href="https://github.com/elastic/azure-functions-apm-nodejs-sample-app">sample Node.js application</a>.</p>
<h3>Application overview</h3>
<p>The Node.js application has two <a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook">HTTP-triggered</a> functions named &quot;<a href="https://github.com/elastic/azure-functions-apm-nodejs-sample-app/blob/main/Hello/index.js">Hello</a>&quot; and &quot;<a href="https://github.com/elastic/azure-functions-apm-nodejs-sample-app/blob/main/Goodbye/index.js">Goodbye</a>.&quot; Once deployed, they can be called as follows, and tracing data will be sent to the configured Elastic Observability deployment.</p>
<pre><code class="language-bash">curl -i https://&lt;APP_NAME&gt;.azurewebsites.net/api/hello
curl -i https://&lt;APP_NAME&gt;.azurewebsites.net/api/goodbye
</code></pre>
<h3>Setup</h3>
<p><strong>Step 0. Prerequisites</strong></p>
<p>To run the sample application, you will need:</p>
<ul>
<li>
<p>An installation of <a href="https://nodejs.org/">Node.js</a> (v14 or later)</p>
</li>
<li>
<p>Access to an Azure subscription with an appropriate role to create resources</p>
</li>
<li>
<p>The <a href="https://learn.microsoft.com/en-us/cli/azure/install-azure-cli">Azure CLI (az)</a> logged into an Azure subscription</p>
<ol>
<li>Use az login to login</li>
<li>See the output of az account show</li>
</ol>
</li>
<li>
<p>The <a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Cwindows%2Ccsharp%2Cportal%2Cbash#install-the-azure-functions-core-tools">Azure Functions Core Tools (func)</a> (func --version should show a 4.x version)</p>
</li>
<li>
<p>An Elastic Observability deployment to which monitoring data will be sent</p>
<ol>
<li>The simplest way to get started with Elastic APM Microsoft Azure is through Elastic Cloud. <a href="https://www.elastic.co/guide/en/elastic-stack-deploy/current/azure-marketplace-getting-started.html">Get started with Elastic Cloud on Azure Marketplace</a> or <a href="https://www.elastic.co/cloud/elasticsearch-service/signup">sign up for a trial on Elastic Cloud</a>.</li>
</ol>
</li>
<li>
<p>The APM server URL (serverUrl) and secret token (secretToken) from your Elastic stack deployment for configuration below</p>
<ol>
<li><a href="https://www.elastic.co/guide/en/apm/guide/8.7/install-and-run.html">How to get the serverUrl and secretToken documentation</a></li>
</ol>
</li>
</ul>
<p><strong>Step 1. Clone the sample application repo and install dependencies</strong></p>
<pre><code class="language-bash">git clone https://github.com/elastic/azure-functions-apm-nodejs-sample-app.git
cd azure-functions-apm-nodejs-sample-app
npm install
</code></pre>
<p><strong>Step 2. Deploy the Azure Function App</strong><br />
Caution icon! Deploying a function app to Azure can incur <a href="https://azure.microsoft.com/en-us/pricing/details/functions/">costs</a>. The following setup uses the free tier of Azure Functions. Step 5 covers the clean-up of resources.</p>
<p><strong>Step 2.1</strong><br />
To avoid name collisions with others that have independently run this demo, we need a short unique identifier for some resource names that need to be globally unique. We'll call it the DEMO_ID. You can run the following to generate one and save it to DEMO_ID and the &quot;demo-id&quot; file.</p>
<pre><code class="language-bash">if [[ ! -f demo-id ]]; then node -e 'console.log(crypto.randomBytes(3).toString(&quot;hex&quot;))' &gt;demo-id; fi
export DEMO_ID=$(cat demo-id)
echo $DEMO_ID
</code></pre>
<p><strong>Step 2.2</strong><br />
Before you can deploy to Azure, you will need to create some Azure resources: a Resource Group, Storage Account, and the Function App. For this demo, you can use the following commands. (See <a href="https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-node#create-supporting-azure-resources-for-your-function">this Azure docs section</a> for more details.)</p>
<pre><code class="language-bash">REGION=westus2   # Or use another region listed in 'az account list-locations'.
az group create --name &quot;AzureFnElasticApmNodeSample-rg&quot; --location &quot;$REGION&quot;
az storage account create --name &quot;eapmdemostor${DEMO_ID}&quot; --location &quot;$REGION&quot; \
    --resource-group &quot;AzureFnElasticApmNodeSample-rg&quot; --sku Standard_LRS
az functionapp create --name &quot;azure-functions-apm-nodejs-sample-app-${DEMO_ID}&quot; \
    --resource-group &quot;AzureFnElasticApmNodeSample-rg&quot; \
    --consumption-plan-location &quot;$REGION&quot; --runtime node --runtime-version 18 \
    --functions-version 4 --storage-account &quot;eapmdemostor${DEMO_ID}&quot;
</code></pre>
<p><strong>Step 2.3</strong><br />
Next, configure your Function App with the APM server URL and secret token for your Elastic deployment. This can be done in the <a href="https://portal.azure.com/">Azure Portal</a> or with the az CLI.</p>
<p>In the Azure portal, browse to your Function App, then its Application Settings (<a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-use-azure-function-app-settings?tabs=portal#settings">Azure user guide</a>). You'll need to add two settings:</p>
<p>First set your APM URL and token.</p>
<pre><code class="language-bash">export ELASTIC_APM_SERVER_URL=&quot;&lt;your serverUrl&gt;&quot;
export ELASTIC_APM_SECRET_TOKEN=&quot;&lt;your secretToken&gt;&quot;
</code></pre>
<p>Or you can use the az functionapp config appsettings set ... CLI command as follows:</p>
<pre><code class="language-bash">az functionapp config appsettings set \
  -g &quot;AzureFnElasticApmNodeSample-rg&quot; -n &quot;azure-functions-apm-nodejs-sample-app-${DEMO_ID}&quot; \
  --settings &quot;ELASTIC_APM_SERVER_URL=${ELASTIC_APM_SERVER_URL}&quot;
az functionapp config appsettings set \
  -g &quot;AzureFnElasticApmNodeSample-rg&quot; -n &quot;azure-functions-apm-nodejs-sample-app-${DEMO_ID}&quot; \
  --settings &quot;ELASTIC_APM_SECRET_TOKEN=${ELASTIC_APM_SECRET_TOKEN}&quot;
</code></pre>
<p>The ELASTIC_APM_SERVER_URL and ELASTIC_APM_SECRET_TOKEN are set in Azure function’s settings for the app and used by the Elastic APM Agent. This is initiated by the initapm.js file, which starts the Elastic APM agent with:</p>
<pre><code class="language-javascript">require(&quot;elastic-apm-node&quot;).start();
</code></pre>
<p>When you log in to Azure and look at the function’s configuration, you will see them set:</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/trace-azure-function-application-observability/blog-elastic-azure-functions-application-settings.png" alt="azure functions application settings" /></p>
<p><strong>Step 2.4</strong><br />
Now you can publish your app. (Re-run this command every time you make a code change.)</p>
<pre><code class="language-bash">func azure functionapp publish &quot;azure-functions-apm-nodejs-sample-app-${DEMO_ID}&quot;
</code></pre>
<p>You should log in to Azure to see the function running.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/trace-azure-function-application-observability/blog-elastic-azure-function-app.png" alt="azure function app" /></p>
<p><strong>Step 3. Try it out</strong></p>
<pre><code class="language-bash">% curl https://azure-functions-apm-nodejs-sample-app-${DEMO_ID}.azurewebsites.net/api/Hello
{&quot;message&quot;:&quot;Hello.&quot;}
% curl https://azure-functions-apm-nodejs-sample-app-${DEMO_ID}.azurewebsites.net/api/Goodbye
{&quot;message&quot;:&quot;Goodbye.&quot;}
</code></pre>
<p>In a few moments, the APM app in your Elastic deployment will show tracing data for your Azure Function app.</p>
<p><strong>Step 4. Apply some load to your app</strong><br />
To get some more interesting data, you can run the following to generate some load on your deployed function app:</p>
<pre><code class="language-bash">npm run loadgen
</code></pre>
<p>This uses the <a href="https://github.com/mcollina/autocannon">autocannon</a> node package to generate some light load (2 concurrent users, each calling at 5 requests/s for 60s) on the &quot;Goodbye&quot; function.</p>
<p><strong>Step 5. Clean up resources</strong><br />
If you deployed to Azure, you should make sure to delete any resources so you don't incur any costs.</p>
<pre><code class="language-bash">az group delete --name &quot;AzureFnElasticApmNodeSample-rg&quot;
</code></pre>
<h2>Analyzing Azure Function APM data in Elastic</h2>
<p>Once you have successfully set up the sample application and started generating load, you should see APM data appearing in the Elastic Observability APM Services capability.</p>
<h2>Service map</h2>
<p>With the default setup, you will see two services in the APM Service map.</p>
<p>The main function: azure-functions-apm-nodejs-sample-app</p>
<p>And the end point where your function is accessible: azure-functions-apm-nodejs-sample-app-ec7d4c.azurewebsites.net</p>
<p>You will see that there is a connection between the two as your application is taking requests and answering through the endpoint.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/trace-azure-function-application-observability/blog-elastic-observability-services.png" alt="observability services" /></p>
<p>From the <a href="https://www.elastic.co/observability/application-performance-monitoring">APM Service</a> map you can further investigate the function, analyze traces, look at logs, and more.</p>
<h3>Service details</h3>
<p>When we dive into the details, we can see several items.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/trace-azure-function-application-observability/blog-elastic-observability-azure-functions-apm.png" alt="observability azure functions apm" /></p>
<ul>
<li>Latency for the recent load we ran against the application</li>
<li>Transactions (Goodbye and Hello)</li>
<li>Average throughput</li>
<li>And more</li>
</ul>
<h3>Transaction details</h3>
<p>We can see transaction details.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/trace-azure-function-application-observability/blog-elastic-observability-get-api-goodbye.png" alt="observability get api goodbye" /></p>
<p>An individual trace shows us that the &quot;Goodbye&quot; function <a href="https://github.com/elastic/azure-functions-apm-nodejs-sample-app/blob/main/Goodbye/index.js#L6-L10">calls the &quot;Hello&quot; function</a> in the same function app before returning:</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/trace-azure-function-application-observability/blog-elastic-latency-distribution-trace-sample.png" alt="latency distribution trace sample" /></p>
<h3>Machine learning based latency correlation</h3>
<p>As we’ve mentioned in other blogs, we can also correlate issues such as higher than normal latency. Since we see a spike at 1s, we run the embedded latency correlation, which uses machine learning to help analyze the potential impacting component by analyzing logs, metrics, and traces.</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/trace-azure-function-application-observability/blog-elastic-latency-distribution-correlations.png" alt="latency distribution correlations" /></p>
<p>The correlation indicated there is a potential cause (25%) due to the host sending the load (my machine).</p>
<h3>Cold start detection</h3>
<p>Also, we can see the impact a <a href="https://azure.microsoft.com/en-ca/blog/understanding-serverless-cold-start/">cold start</a> can have on the latency of a request:</p>
<p><img src="https://www.elastic.co/observability-labs/assets/images/trace-azure-function-application-observability/blog-elastic-trace-sample.png" alt="trace sample" /></p>
<h2>Summary</h2>
<p>Elastic Observability provides real-time monitoring of Azure Functions in your production environment for a broad range of use cases. Curated dashboards assist DevOps teams in performing root cause analysis for performance bottlenecks and errors. SRE teams can quickly view upstream and downstream dependencies, as well as perform analyses in the context of distributed microservices architecture.</p>
<h2>Learn more</h2>
<p>To learn how to add the Elastic APM Agent to an existing Node.js Azure Function app, read <a href="https://www.elastic.co/guide/en/apm/agent/nodejs/master/azure-functions.html">Monitoring Node.js Azure Functions</a>. Additional resources include:</p>
<ul>
<li><a href="https://www.elastic.co/blog/getting-started-with-the-azure-integration-enhancement">How to deploy and manage Elastic Observability on Microsoft Azure</a></li>
<li><a href="https://www.elastic.co/guide/en/apm/guide/current/apm-quick-start.html">Elastic APM Quickstart</a></li>
</ul>
]]></content:encoded>
            <category>observability-labs</category>
            <enclosure url="https://www.elastic.co/observability-labs/assets/images/trace-azure-function-application-observability/09-road.jpeg" length="0" type="image/jpeg"/>
        </item>
    </channel>
</rss>